Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

more sql help please


RCWS

Recommended Posts

Posted

when i click "invoice" or "packing slip" the new window says

 

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 'where orders_id = '5'' at line 1

 

select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_piva, billing_cf billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, ipaddy, ipisporders fromorders where orders_id = '5'

 

 

I have asked about this before and just dont know what to do.

Thanks in advance !

Toby Wilson

Posted

you are missing a space in "fromorders" should be "from orders"

 

in the function query it probably looks like

 

"from" . TABLE_ORDERS"

 

but should be

 

"from " . TABLE_ORDERS"

 

edit admin/includes/classes/orders.php

 

find the function query it should be exactly like this if not replace it or edit it

 

	function query($order_id) {
  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
  $order = tep_db_fetch_array($order_query);

  $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  while ($totals = tep_db_fetch_array($totals_query)) {
	$this->totals[] = array('title' => $totals['title'],
							'text' => $totals['text']);
  }

 

the above code is from

$Id: order.php,v 1.7 2003/06/20 16:23:08

Posted

Thank you for your help !

You fixed my problem !

 

Can you tell me why what I did was wrong ?

I'm trying to learn by my mistakes.........

Toby Wilson

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...