I have never used JOINs or have worked with multiple table before.
This error is popping up.
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in [pathway to this mysql_query line].
What am I doing wrong here?
Thank you.
$group_id= 4;
$result = mysql_query("SELECT table1.user_facebook_id AS user_facebook_id
FROM table1 JOIN table2
ON table1.user_id = table2.user_id
WHERE table2.group_id = $group_id");
$row = mysql_fetch_assoc($result);
You should test the value of
$resultto see if the query failed. If so, print the error for debugging purposes:You may also want to try running the SQL query in the MySQL workbench to see if it works there.