jim.davidson Posted May 3, 2007 Share Posted May 3, 2007 I run this code and everything is OK $query_getOrder = sprintf("SELECT orders.customer_id, orders.order_date, orders.received_date, orders.updated_date, orders.received_by, orders.destroyed_by, orders.model_number, orders.serial_number, orders.capacity, orders.confirmation_id, customers.contact_name, customers.contact_phone, manufacturers.manufacture_name FROM orders LEFT JOIN customers ON orders.customer_id = customers.customer_id LEFT JOIN manufacturers ON orders.manufacturer_id = manufacturers.manufacturer_id WHERE orders.confirmation_id = %s", GetSQLValueString($colname_getOrder, "text")); mysql_select_db($database_imcrecycle, $imcrecycle); $getOrder = mysql_query($query_getOrder, $imcrecycle) or die(mysql_error()); $row_getOrder = mysql_fetch_assoc($getOrder); $totalRows_getOrder = mysql_num_rows($getOrder); Tried to format date with this code…. $query_getOrder = sprintf("SELECT orders.customer_id, DATE_FORMAT(orders.order_date, '%b %e, %y') AS order_date, orders.received_date, orders.updated_date, orders.received_by, orders.destroyed_by, orders.model_number, orders.serial_number, orders.capacity, orders.confirmation_id, customers.contact_name, customers.contact_phone, manufacturers.manufacture_name FROM orders LEFT JOIN customers ON orders.customer_id = customers.customer_id LEFT JOIN manufacturers ON orders.manufacturer_id = manufacturers.manufacturer_id WHERE orders.confirmation_id = %s", GetSQLValueString($colname_getOrder, "text")); mysql_select_db($database_imcrecycle, $imcrecycle); $getOrder = mysql_query($query_getOrder, $imcrecycle) or die(mysql_error()); $row_getOrder = mysql_fetch_assoc($getOrder); $totalRows_getOrder = mysql_num_rows($getOrder); I get this error Warning: sprintf() [function.sprintf]: Too few arguments in C:\Sites\recycle_view_order.php on line 104 Query was empty What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/49887-solved-date-formating-problem/ Share on other sites More sharing options...
jim.davidson Posted May 4, 2007 Author Share Posted May 4, 2007 Sorry about tripe post, won't happen again. Answer can be found on PHP help forum Quote Link to comment https://forums.phpfreaks.com/topic/49887-solved-date-formating-problem/#findComment-245351 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.