Okay, a little problem ... can't figure this one out.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MPS Project Tracking - by Brian Medley</title>
</head>
<?php
mysql_connect('localhost', 'brian', 'some_pass') or die(mysql_error());
mysql_select_db('reports') or die(mysql_error());
$table = $_GET['table'];
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM `$table` WHERE id=`$id`");
while($row = mysql_fetch_array($sql))
{
echo $row['date'] . " " . $row['report'];
}
?>
<body>
</body>
</html>
And I get this error when I display the page:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\new_mps\report\edit_report.php on line 16