Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:09:12+00:00 2026-05-31T23:09:12+00:00

<?php require ‘database.php’; $query = SELECT id, date, ponumber FROM so; $result = $mysqli->query($query)

  • 0
<?php

require 'database.php'; 
$query = "SELECT id, date, ponumber FROM so";

$result = $mysqli->query($query) or die(mysqli_error($mysqli));

if ($result) {
  echo "<form method='post' action='delete.php'>"; 

  echo "<table cellspacing='0' cellpadding='15' border='1'>
  <th >DELETE</th>
  <th >VIEW</th>
  <th >ID</th>
  <th >DATE</th>
  <th >PO NUMBER</th>";

  while ($row = $result->fetch_object()) {

$date      = $row->date ;
$ponumber  = $row->ponumber;
$id        = $row->id;
//put each record into a new table row with a checkbox
echo "<tr>
    <td>
        <input type='checkbox' name='checkbox[]' id='checkbox[]'  value=$id />
    </td>
     <td>
        $id
     </td>
     <td>
        <a href="view.php">view</a>
     </td>
    <td>
         $date
    </td>
<td>
       $ponumber
     </td>
  </tr>"; 
    }

   echo "</table><p><input id='delete' type='submit' class='button' name='delete' 

       value='Delete Selected Items'/></p></form>";}
?>

i have a sort of an online order form which enable the sales rep to input sales order,
i have done the insert and delete using the code above now i want every row to be a hyperlink so that when they click view it will display only row that has been clicked, in my code above if you click :view” all the detail will display, how can i display only the row that i will click will display the detail of the record!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:09:13+00:00Added an answer on May 31, 2026 at 11:09 pm

    you need to pass the id in the url and you need to read it if it’s there.

    e.g.

    <?php
    require 'database.php'; 
    $query = "SELECT id, date, ponumber FROM so";
    /* Edit 1 */
    if (!empty($_GET['id'])) { 
        $query .= " WHERE id = " . mysql_real_escape_string($_GET['id']);
    }
    /* Edit 1 end */
    $result = $mysqli->query($query) or die(mysqli_error($mysqli));
    if($result) {
        echo "<form method='post' action='delete.php'>"; 
        echo "<table cellspacing='0' cellpadding='15' border='1'>
                <th >DELETE</th><th >VIEW</th><th >ID</th><th >DATE</th><th >PO NUMBER</th>";
        while ($row = $result->fetch_object()) {
            $date = $row->date ;
            $ponumber = $row->ponumber;
            $id = $row->id;
            //put each record into a new table row with a checkbox
            echo "<tr>
                      <td><input type='checkbox' name='checkbox[]' id='checkbox[]'  value=$id /></td>
                      <td>$id</td>
                      <td>";
                /* Edit 2 */
                echo "<a href='view.php?id=$id'>view</a>";
                /* Edit 2 End */
                echo "</td>
                      <td>$date</td>
                      <td>$ponumber</td></tr>"; 
        }
        echo "</table><p><input id='delete' type='submit' class='button' name='delete' value='Delete Selected Items'/></p></form>";}
    ?>
    

    A style suggestion:

    Don’t do/stop doing this:

    echo "<form method='post' action='delete.php'>"; 
    echo ...
    while
    

    Where what you are echoing is a static string. Instead, do:

    ?>
    <form method='post' action='delete.php'>
    ...
    <?php
    while
    

    it’s simply easier to read and maintain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Html Form Submitted from <?php //////////////////////////////////////////////////////////////////////////////////// ###### Require Database ###### //////////////////////// require_once('src/cfg/dbi.php'); //////////////////////////////////////////////////////////////////////////////////// ######
PHP PDO Singleton Class: <?php require_once('app/config.php'); // Require constants HOST, DATABASE, USER, PASSWORD /*
when I include vars.php: $var='hello'; in index.php: require 'vars.php'; echo $var; it works great,
i have a script like this : <html> <body> <?php require("wrongFile.php"); echo "Hello World!";
The server Contents are server.php: <?php $err[foo]=bar; ?> The client.php <?php require 'server.php'; echo
//I need an output array from my database, //I tried: <?php require_once(includes/connection.php); ?> <?php
I have the following pages. index.php <?php require('configure.php'); ?> configure.php <?php die(); ?> The
is it possible to make something like this? // file.php $string = require('otherfile.php'); echo
main.php: require /root/test.php; print_r(apc_cache_info()); apc_bin_dump(array(/root/test.php)); test.php: $x = a; echo $x; test.php is successfully
I am having a problem with PHP from that adds data to MYSQL database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.