Jump to content

[SOLVED] Date formating problem


jim.davidson

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/49880-solved-date-formating-problem/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.