I have problem.... i need a count of how many firms name are searched in the table of Requests, The firm ID is in the table Com...
$name=("SELECT SUBSTRING(Name,1,4) FROM Com WHERE Com.ComID=\'$CID\'");
$query=("SELECT count(*) as CD FROM Com LEFT JOIN Requests ON
Com.ComID=Requests.ID WHERE Action=\'search\' && Keyword like
\'%$name%\'");
$result=mysql_query("$query");
while($r = mysql_fetch_array($result)) {
$r[CD];
}
The problem is that SQL dont accepts $name in Keyword like \'%$name%\'\");
May be someone can help.....any ideas?? :?: