Page 2 of 2 First 12
  • Jump to page:
    #16
  1. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    I don't get the issue. You wrote down the complete query (minus one column) in #9. The only problem was this backticks thingy. Remove the backticks (as suggested several times), add the column, and you're done.

    That shouldn't be too difficult.

    sql Code:
    SELECT
    	pr.prod_description
    	, pr.prod_id
    	, pr.prod_name
    	, pr.prod_mainImage
    	, pr.prod_model
    	, assoc.prod_order
    FROM
    	products AS pr
    	LEFT JOIN
    		category_assoc AS assoc ON assoc.prod_id = pr.prod_id
    WHERE
    	assoc.cat_id = 4
    ORDER BY
    	assoc.prod_order
    ;
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  2. #17
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Code:
    SELECT pr.prod_description 
         , pr.prod_id 
         , pr.prod_name 
         , pr.prod_mainImage 
         , pr.prod_model 
         , ca.prod_order
      FROM category_assoc AS ca
    INNER
      JOIN products AS pr
        ON pr.prod_id = ca.prod_id 
     WHERE ca.cat_id = 4  
    ORDER 
        BY ca.prod_order LIMIT 30
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo