Jump to content

Left Outer Join


RON_ron

Recommended Posts

I'll getting data from two different databses. Code A is the current code (works well). After doing some modifications (Code B), now the code outputs nothing . Could someone help to correct the error in Code B?

 

Code A

 

$query = "SELECT * FROM furniture LEFT OUTER JOIN furnitureBrands ON furniture.itemCode = furnitureBrands.theName ORDER BY furniture.key DESC;
$results = mysql_query($query);

 

Code B

$query = "SELECT * FROM furniture LEFT OUTER JOIN furnitureBrands ON furniture.itemCode = furnitureBrands.theName WHERE furniture.checked = '0', furniture.availability = 'yes' ORDER BY furniture.key DESC;
$results = mysql_query($query);

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/271061-left-outer-join/
Share on other sites

A look at the value of mysql_error() helps in these circumstance.

 

Do that,then try

 

$query = "SELECT * FROM furniture
 LEFT OUTER JOIN furnitureBrands ON furniture.itemCode = furnitureBrands.theName
WHERE furniture.checked = '0'
 AND furniture.availability = 'yes'
ORDER BY furniture.key DESC";

Link to comment
https://forums.phpfreaks.com/topic/271061-left-outer-join/#findComment-1394567
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.