Mysql Fetch Assoc() Error
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2973202/php-error-mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given">PHP Error: mysql_fetch_array() expects parameter 1 to be resource, boolean given</a>  </p>
</blockquote>



<p>I am new in PHP, need some advice on the following code. I get the following error:</p>

<blockquote>
  <p>Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wd\categories.php on line 42</p>
</blockquote>

<p>PHP Code:</p>

<pre><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;

}
</code></pre>

<p>Any assistance will be appreciated.</p>

<p>The error i get with echo mysql_error();:</p>

<p>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</p>
