Hi, I'm having a nightmare, Why does this keep coming up, I'm trying to display the contents of a Table, but it keeps coming up with this:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/home/stcontractcom/public_html/view.php on line 20
It can be found at:
www.1stcontract.com
And here is my code:
<?
include('standard.php');
$dbh = mysql_connect($host, $user, $pass);
mysql_select_db($name);
$MasterTable = MasterTable;
//echo $MasterTable;
$stmt = "SELECT * FROM $MasterTable";
//echo $stmt;
$sth = mysql_query($stmt, $dbh);
//echo $sth;
//need to parse the variables from 2 behind, thats why it does not
//recognise the variable.
while($row = mysql_fetch_array($sth, MYSQL_ASSOC)) {
echo $row["ID"];
echo $row["Surname"];
echo $row["Forename"];
echo $row["LinktoName"];
}
// mysql_free_result ($sth);
mysql_close ($dbh);
?>
Any help will be gratefully appreciated.
Thanks