♥yesudo Posted February 26, 2004 Posted February 26, 2004 I am using this query: $customers_query_raw = "select c.customers_id, s.sources_name, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c join " . TABLE_ADDRESS_BOOK . " a join " . TABLE_SOURCES. " s join " . TABLE_CUSTOMERS_INFO. " i on s.sources_id = c.entry_source_id and i.customers_info_id = c.customers_id and c.customers_id = a.customers_id and c.customers_default_address_id = a. address_book_id " . $search . " order by i.customers_info_date_account_created desc, c.customers_lastname, c.customers_firstname"; Someone else has got this error when using it: 1064 - You have an error in your SQL syntax near 'on s.sources_id = c.entry_source_id and i.customers_info_id = c.customers_id and' at line 1 select count(*) as total from customers c join address_book a join sources s join customers_info i on s.sources_id = c.entry_source_id and i.customers_info_id = c.customers_id and c.customers_id = a.customers_id and c.customers_default_address_id = a. address_book_id Are there different versions of SQL which work on different syntax ? Your online success is Paramount.
peterx Posted February 27, 2004 Posted February 27, 2004 Just use the standard inner join and where clause to filter out rows. select count(1) from TableA a, TableB b where a.id = b.fkey It will solve most simple join queries.
♥yesudo Posted February 27, 2004 Author Posted February 27, 2004 Thanx Peter will try. Your online success is Paramount.
Guest Posted April 2, 2004 Posted April 2, 2004 Hi, i'm getting the same error. Are you able to post the code that got it working for you? (assuming you got it working!) THANKS!
♥yesudo Posted April 2, 2004 Author Posted April 2, 2004 http://www.oscommerce.com/forums/index.php?showtopic=79827&st=40 Your online success is Paramount.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.