Jump to content

MySql Left Join problem


SocomNegotiator

Recommended Posts

I am having problems with this sql query...

 

<?php
$db->query('SELECT item.id, item.name, item.description, pre_order.id, pre_order.amount, pre_order.user_id FROM `pre_order` LEFT JOIN `item` ON pre_order.item_id = item.id WHERE pre_order.user_id='.$user_id) or die(mysql_error());


while($row = $db->fetch_array())	{

}?>

 

Now with my while I should be able to say $row['name'] or $row['item.name'], but it is not working...do I have an error in my join? Any help would be much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/116316-mysql-left-join-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.