There is apparently a problem with this code on line 20 and 25, the error i get is:
Warning: Supplied argument is not a valid MySQL result resource in /usr/home/h/u/huntingdonshirei/public_html/dbmysql.php on line 20
Warning: Supplied argument is not a valid MySQL result resource in /usr/home/h/u/huntingdonshirei/public_html/dbmysql.php on line 25
Any Ideas?
Thanks
Code:
<?
include_once("standard.php");
$dbh = mysql_connect($host, $user, $pass);
mysql_select_db($name);
$stmt = "builders";
$sth = mysql_query($stmt, $dbh);
/* Print $name;
Print $dbh;
Print $host;
Print $user;
Print $pass;
Print $stmt;
Print $sth */
while ($row = mysql_fetch_array($sth, MYSQL_ASSOC)) {
echo $row["companyname"];
echo $row["address"];
echo $row["telephone"];
}
mysql_free_result ($sth);
mysql_close ($dbh)
?>
Warning: Supplied argument is not a valid MySQL result resource in /usr/home/h/u/huntingdonshirei/public_html/dbmysql.php on line 20
Warning: Supplied argument is not a valid MySQL result resource in /usr/home/h/u/huntingdonshirei/public_html/dbmysql.php on line 25
Any Ideas?
Thanks
Code:
<?
include_once("standard.php");
$dbh = mysql_connect($host, $user, $pass);
mysql_select_db($name);
$stmt = "builders";
$sth = mysql_query($stmt, $dbh);
/* Print $name;
Print $dbh;
Print $host;
Print $user;
Print $pass;
Print $stmt;
Print $sth */
while ($row = mysql_fetch_array($sth, MYSQL_ASSOC)) {
echo $row["companyname"];
echo $row["address"];
echo $row["telephone"];
}
mysql_free_result ($sth);
mysql_close ($dbh)
?>