View Single Post
  #6 (permalink)  
Old 02-25-10, 04:04
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by vivoices View Post
here is the syntax that works
could i ask you to change it slightly please?
Code:
SELECT products.product_id
     , products.thumb_img_id
     , products.big_img_id
     , nameID.resource_name
     , descriptionId.resource_name
  FROM products
INNER 
  JOIN text_resource_names AS nameID
    ON nameID.text_id = products.name_text_id
INNER
  JOIN text_resource_names AS descriptionId
    ON descriptionId.text_id = products.description_text_id 
 WHERE products.page_id = " . $page_id . "
ORDER 
    BY products.displayOrder ASC
note how the INNER JOINs are written

you should stay away from the "comma list" style of joining, you'll just get into trouble
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote