-
Error - MySQL Array
PHP Code:
<?php @mysql_connect(localhost,USER,PASS) or die(mysql_error());
mysql_select_db(DATABASE) or die(mysql_error());
$query = "SELECT * FROM `config`";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
?>
I keep getting an error on:
PHP Code:
while($r=mysql_fetech_array($result))
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource..."
Please help me with this.
The database is setup and tables are correct.
-
Re: Error - MySQL Array
The query on the database failed. You should check for this everytime you execute an SQL query. Your problem is caused by the back ticks `, they should only be used for field names:
PHP Code:
if (! $result = mysql_query($query)) {
die(mysql_error());
}