I’m trying this:
$result = mysql_query("
SELECT Users.*, Posts.*
FROM Users
INNER JOIN Posts ON Users.User = Posts.User
WHERE MATCH (Posts.City) AGAINST ('$city2')
ORDER BY Posts.`Date` DESC LIMIT 10");
if(!$result) {
{
die('Error: ' . mysql_error());
}
I’m not getting an error but I’m getting zero results.
I don’t know what I’m doing wrong, in fact I think I didn’t change anything and it was working before. I believe that adding quotes or something could fix the issue but I’m not sure what to do. A simpler query to select only from posts without the inner join works perfectly. What am I doing wrong?
Thanks
You’re calling
mysql_querymore than once. Try changing yourifstatement to this:Also, I hope nobody lives in a city with an apostrophe!