Jump to content

[SOLVED] Date formating problem


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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.