I have done this before with no problems before. What am I doing wrong..
This is how I set the url. This page works fine. It shows contactinfo.php?id=1, contactinfo.php?id=2, etc. for each link
<?
//Connect to database
$conn = mysql_pconnect("localhost", "root", "wharleo");
if(!$conn)
echo "Error connecting to database";
if (!mysql_select_db("contactinfo"))
echo "Could find the database";
$query = "SELECT id, name FROM people";
$result = mysql_query($query);
if(!$result)
echo "Could not run query to get all contacts";
$num_of_contacts = mysql_num_rows($result);
echo "<br><br><br>";
echo "<table width='50%' border='3' cellpadding='0' cellspacing='0' align='center' bgcolor='#000000'>";
echo "<th colspan=2>List of All Contacts</th>";
for($i=0;$i<$num_of_contacts;$i++)
{
$row = mysql_fetch_array($result);
echo "<tr>";
echo "<td>";
echo "<div align=left>";
echo "<a href=contactinfo.php?id=";
echo $row["id"];
echo ">";
echo $row["name"];
echo "</a>";
echo "</div>";
echo "</td>";
echo "</tr>";
}
echo "</table>";
?>
This is how I query the database with that id #
<?
//Connect to database
echo "ID = ".$id;
$conn = mysql_pconnect("localhost", "root", "wharleo");
if(!$conn)
echo "Error connecting to database";
if (!mysql_select_db("contactinfo"))
echo "Could find the database";
$query = "SELECT * FROM people WHERE id = '$id'";
echo "<br>Query: ".$query;
$result = mysql_query($query);
if(!$result)
echo "Error getting contact info";
$row = mysql_fetch_array($result);
$num_rows = mysql_num_rows($result);
echo "<br>Number of rows found: ". $num_rows;
?>