Possible Duplicate:
PHP Error: mysql_fetch_array() expects parameter 1 to be resource, boolean given
I am new in PHP, need some advice on the following code. I get the following error:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wd\categories.php on line 42
PHP Code:
$SQL= "FROM wdccat WHERE caid='$id'
LEFT JOIN wdcat ON wdccat.caid = wdcat.ccid
LEFT JOIN wdclient ON wdccat.clid = wdclient.cid";
$result = mysql_query($SQL);
((Line 42)) while ($db_field = mysql_fetch_assoc($result)) {
echo $str1;
echo $str2;
print $row['cid'];
echo $str3;
print $row['cid'];
echo $str4;
print $row['climage'];
echo $str5;
print $row['cname'];
echo $str6;
print $row['cid'];
echo $str7;
print $row['cname'];
echo $str8;
print $row['cid'];
echo $str9;
echo $str10;
}
Any assistance will be appreciated.
The error i get with echo mysql_error();:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN wdcat ON wdccat.caid = wdcat.ccid LEFT JOIN wdclient ON wdccat.cl' at line 2 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wd\categories.php on line 42