I am working on a project which allows me to create a customer database. I have made an Create.php and Delete.php but am having issues with the basic structure for an Edit page.
My initial idea is to create a populated drop down box (Which I can do) which on click will take the user to domain.com/Customer.php?Customer_name=”JohnD”
I am having a few issues with regards to this as it is doing 2 things.
- It is printing out ALL of the data in my table into the echo.
- It isn’t taking the values from the URL, However I know that I have missed something but am unsure of what I need to search for.
Here is my snippet so far:
<h2>
<?Php
$sql="SELECT id,customer_name FROM Customers";
$result =mysql_query($sql);
while ($data=mysql_fetch_assoc($result)){
?>
<?Php echo $data['customer_name']; } ?>
</h2>
As of yet I am getting this in the header:
John Doe Jimmy Timmy Test
These are all the values inside my rows for the table Customers.
Sorry if the question seems all over the place. I will correct if it is not easy to understand.
Thanks in advance
use this url
and the code should look like