Mysql Problem

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

Can anyone see why I am getting the following error with this code

Warning: sprintf() [function.sprintf]: Too few arguments in /****.php on line 64

Code:
$query_rec_order_details = sprintf("SELECT *, date_format(date_time, '%Y-%c-%e') as formatted_date from tbl_orders 
		LEFT JOIN tbl_order_status_option ON tbl_order_status_option.order_status_id = tbl_orders.order_status
		LEFT JOIN tbl_shipping_methods ON tbl_shipping_methods.shipping_method_id = tbl_orders.shipping_method_id
	    WHERE formatted_date >= '$start_date' AND formatted_date =< '$end_date'");


Any help appreciated

Thanks
Aaron
 
Interesting - that has solved one problem but now with the code below I am getting another error.

Unknown column 'date' in 'where clause'

Code:
$query_rec_order_details = sprintf("SELECT *, date_format(tbl_orders.date_time, '%%Y-%%c-%%e') as date from tbl_orders 
		LEFT JOIN tbl_order_status_option ON tbl_order_status_option.order_status_id = tbl_orders.order_status
		LEFT JOIN tbl_shipping_methods ON tbl_shipping_methods.shipping_method_id = tbl_orders.shipping_method_id
	    WHERE date >= '$start_date' AND date <= '$end_date'");
 
Sadly that still didnt't seem to work. It is still saying that the column in unknown

Any other suggestions?

Thanks
Aaron
 
Back
Top Bottom