I am trying to join a table measurement to customer in the admin folder but keep getting this error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') c left join measurement m on c.customers_measurements_id = m.measurement_id wh' at line 1
.
can anyone help.
Latest News: (loading..)
joining 3 tables
Started by daone, Jul 31 2009, 12:19
4 replies to this topic
#1
Posted 31 July 2009, 12:19
#2
Posted 31 July 2009, 13:05
And your sql statement is?
Jack
Jack
Recommended SEO Addons:
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#3
Posted 31 July 2009, 13:24
Jack_mcs, on Jul 31 2009, 02:05 PM, said:
And your sql statement is?
Jack
Jack
$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, m.neck_measurement, m.chest_measurement, m.sleeve_measurement, m.stomach_measurement, m.waist_measurement, m.outer_leg_measurement, m.inside_leg_measurement, m.length_measurement, m.shoulder_measurement, m.bust_measurement, m.hip_measurement, m.crotch_measurement, m.back_measurement, m.cuff_measurement, m.thigh_measurement, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, c.customers_measurements_id from (" . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id) where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "') left join ". TABLE_MEASUREMENT ." m on c.customers_measurments_id = measurement_id");
#4
Posted 31 July 2009, 14:33
Try this
Jack
$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, m.neck_measurement, m.chest_measurement, m.sleeve_measurement, m.stomach_measurement, m.waist_measurement, m.outer_leg_measurement, m.inside_leg_measurement, m.length_measurement, m.shoulder_measurement, m.bust_measurement, m.hip_measurement, m.crotch_measurement, m.back_measurement, m.cuff_measurement, m.thigh_measurement, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, c.customers_measurements_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on a.customers_id = c.customers_id left join " . TABLE_MEASUREMENT . " m on c.customers_measurments_id = m.measurement_id where c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
Jack
Recommended SEO Addons:
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
Most Important: Header Tags SEO - Ultimate SEO V 2.2d
All SEO Addons: Recommended SEO Addons
Support Links:
Finding relevant link exchanges - Headers Already Sent - What does it cost? -What's my version? - How to change titles? - Preventing HotLinking
#5
Posted 01 August 2009, 15:00
Jack_mcs, on Jul 31 2009, 03:33 PM, said:
Try this
Jack
$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, m.neck_measurement, m.chest_measurement, m.sleeve_measurement, m.stomach_measurement, m.waist_measurement, m.outer_leg_measurement, m.inside_leg_measurement, m.length_measurement, m.shoulder_measurement, m.bust_measurement, m.hip_measurement, m.crotch_measurement, m.back_measurement, m.cuff_measurement, m.thigh_measurement, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, c.customers_measurements_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on a.customers_id = c.customers_id left join " . TABLE_MEASUREMENT . " m on c.customers_measurments_id = m.measurement_id where c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
Jack
Thank u, Thank u, Thank u, it worked a treat.














