This question already has an answer here:
I have the following piece of code. Drives me crazy. Cannot find where is my mistake. Looks like there is a conflict with the use of limit in my sql syntax and the mysql_query in variable $result does not return anything.
<?php
$sql = " select * from `share` where (`category` LIKE '$category' and `country` LIKE '$country' and `city` LIKE '%$city_name%' and `job_title` LIKE '%$job_name%' and `user_id`!='$session_user_id')
order by `share_id` desc LIMIT 3; ";
$result = mysql_query($sql);
if( mysql_num_rows($result) ==0 ){
echo"success";
}
?>
</div>