I have an older MySQL installation (v. 3.23.58) on my host (I don't know if newer version don't have this problem), and the checkout was breaking on step 1 with this error message:
Code:
1064 You have an error in your SQL syntax near '(zen_address_book ab left join zen_zones z o' at line 7
in:
[select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from zen_customers c, (zen_address_book ab left join zen_zones z on (ab.entry_zone_id = z.zone_id) left join zen_countries co on (ab.entry_country_id = co.countries_id) ) where c.customers_id = '2' and ab.customers_id = '2' and c.customers_default_address_id = ab.address_book_id]
I tracked it down to the parentheses around the phrase following "from zen_customers c, ". I removed them from includes/classes/order.php and it works now.
Here is the output of 'diff -ub', hopefully it won't wrap too badly:
PHP Code:
--- order.php-dist 2006-05-25 22:10:07.000000000 -0800
+++ order.php 2006-05-25 22:15:22.000000000 -0800
@@ -235,9 +235,9 @@
z.zone_name, co.countries_id, co.countries_name,
co.countries_iso_code_2, co.countries_iso_code_3,
co.address_format_id, ab.entry_state
- from " . TABLE_CUSTOMERS . " c, (" . TABLE_ADDRESS_BOOK . " ab
+ from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab
left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
- left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) )
+ left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id)
where c.customers_id = '" . (int)$_SESSION['customer_id'] . "'
and ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
and c.customers_default_address_id = ab.address_book_id";
I hope that helps someone else! It would probably be a good candidate for the code base too but I don't know who is in charge of that :)
-n
Bookmarks