I have this sql query but I want to add DESC to it but am getting error ( Error!: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ‘DESC LIKE ‘%a%’’
at line 1 ) Pls kindly help me out.
$sql = 'SELECT * FROM business WHERE concat(business_name, " ", business_title) DESC';
foreach($aParams as $i2 => $param):
if($i2==0):
$sql = $sql .' LIKE ? ';
else:
$sql = $sql .' AND concat(business_name, " ", business_title) LIKE ? ' ;
endif;
endforeach;
#echo DEBUG, '$sql = ',$sql, '<br />';
return $sql;