I have a database with a table name "neworders"
In new orders I have Columns with the names
"ID"
"Name"
"Address"
"Email"
The ID column is set to Auto-Increment.
How Can I display all entries in that table that have a value in the column "Name"
What I am saying is.
I want to click on my page thats labeled customers.php
and it will show me in a vertical list
"Name1"
"Name2"
"Name3"
"Name4"
"Name5"
"Name6"
and so fourth.
Then if I click on that name I can retrieve all of the information for that specific person.
This is how I have saved the information
sqli = mysqli_query($con, "INSERT INTO newworders (ID, first, last, height, weight, street, city, state, zip) VALUES ('', '$First', '$Last', '$height', '$weight', '$street', '$city', '$state', '$zip')");
$query = mysqli_query($con, "SELECT * FROM newworders WHERE first = '".$First."'") or die("Can not query the TABLE");
while($roww = mysqli_fetch_array($query)) {}
But I know this wont work to display everything in "first" in the table because I am saying if it only equals that certain value. Which if that value changes I still want it to show me on the list all of the entries i have...
Get rid of the limit and use the returned data to create the link. Here is an example:
$query = mysqli_query($con, "SELECT * FROM newworders") or die(mysqli_error()); // get any actual error
while($row = mysqli_fetch_array($query)) {
echo '<a href="user.php?uid=' . $row['id'] . '">' . $row['first'] . '</a><br />';
}
Notice how the data from the query is concatenated into the HTML output. This is a basic building block. In addition, the link has a query string which allows you to get the user's info into the user page.
user.php (example)
$userID = $_GET['uid']; // from the query string in the link
$query = mysqli_query($con, "SELECT * FROM newworders WHERE ID = '". $userID ."'") or die(mysqli_error()); // get any actual error
// echo out user details:
$user = mysqli_fetch_array($query);
echo $user['first'];
echo $user['last'];
...
While we continued in the style you originally set (variables concatenated into query) you really should learn about prepared statements.