Jump to content

ppunzi

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ppunzi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your help. That makes sense. I guess my next question is how do I nest that within the CASE if I need the result to be a variable - can I run the RIGHT JOIN and MYSQL_FETCH_ARRAY outside of the Case phrasing and have the result look like a variable from a table to input into the CASE statement?
  2. Sorry forgot the guideline info: MySQL version 5.0.91-community-log SQL RIGHT JOIN Syntax: SELECT column_name(s) FROM table_name1 RIGHT JOIN table_name2 ON table_name1.column_name=table_name2.column_name
  3. I have two tables manufacturer and product. The product table has a column called manufacturer that corresponds to the manufacturer id (key) I am trying to create a table with a single column that has all the rows of the product table but only returns the names from the names column and null if there is no manufacturer. I used the following inside a case which is sending the results to a tab delimited file: case 'brand': $item[brand] = mysql_query("SELECT manufacturers.name FROM manufacturers RIGHT JOIN products ON manufacturers.id = products.manufacturer"); The problem is I am receiving resource ID # error messages in the resulting tab delimited file and I am not sure if there is a problem with the usage of RIGHT JOIN or nesting it in a case statement. Thanks for any help.
  4. I have learned php coding by doing (looking for patterns and trying things) and I have hit a roadblock trying to modify a template that creates a delimited text file of products from an ecommerce site (Sunshop) for upload to google base. I have tried to search for the answer but I don't know what I don't know so I may not have put the right search terms in. So I apologize if this has been addressed in the past. The script uses case to call up the contents of specific rows of the product table which I understand but in when I want to call up the manufacturer row Sunshop uses a reference number and then a different table called manufacturers with an ID row that matches the manufacturer row numbers (that are associated with each product) and then next to it a name row which contains the actual manuracturer names. Can I put code in the case that will pull up the referenced name as opposed to just the numbers that are in the column? This is what I have now that just calls up the cells from the manufacurer row: case 'mfg': $item[mfg] = $item[manufacturer]; The mfg refers to this part of the code in an array: array('header' => 'manufacturer', 'value' => 'mfg'), In case it helps I will attach the full document. Thanks. [attachment deleted by admin]
×
×
  • 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.