PDA

Click to See Complete Forum and Search --> : Error - MySQL Array


articwoof
Apr 23rd, 2005, 03:08 PM
<?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: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.

visualAd
Apr 23rd, 2005, 03:39 PM
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:

if (! $result = mysql_query($query)) {
die(mysql_error());
}