Im having a problem with my query. I recently switched to PDO, which is kind of new to me. Now i need to use JOIN in my query to get data from another table without making two e
Change your query with this one:
$query = "SELECT * FROM `friends` as F INNER JOIN `users` as U ON `F.friendID` = `U.id` WHERE `F.userID` = '{$sess_user}' AND `F.request` = '0'";
And add this to your connection, it will show you the errors:
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Set Errorhandling to Exception
Don't put back ticks around the `table.field` ... You have to put them around `table`.`field`
IMHO! I saw problems like that with PDO... and... i think it's more likely to do all with pure SQL but good then duck your head with PDO.