I am new to PHP and have being trying to get this bit of code to work. The problem seems to be the $ID value if I chaneg it to a 1 or 2 it displays the corresponding record. It should display all the records not sure why. Can you assist?
<html>
<h2>List Records</h2>
<a href='add.php'>Add Record</a><br>
</html>
<?php
include("connect.php");
$sql = "SELECT * FROM daniels_addresses WHERE ID='$ID'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
while($result = mysql_fetch_array($query)) {
$FirstName = stripslashes($result["FirstName"]);
$LastName = stripslashes($result["LastName"]);
$Address = stripslashes($result["Address"]);
$Email = stripslashes($result["Email"]);
$ID = $result["ID"];
echo "$FirstName $LastName [<a href='edit.php?id=$ID'>Edit</a> | <a href='delete.php?id=$ID'>Delete</a>]<br>";
}
?>