Jump to content

GetSQLValueString() function question


Recommended Posts

Here’s my code for updating a record:

 

$received_date = now()

$updateSQL = sprintf("UPDATE orders SET destroyed=%s, destroyed_pic=%s, received=%s, received_pic=%s, model_number=%s, serial_number=%s, capacity=%s, confirmation_id=%s WHERE order_id=%s",

                      GetSQLValueString($_POST['destroyed'], "text"),

                      GetSQLValueString($_POST['destroyed_pic'], "text"),

                      GetSQLValueString($_POST['received'], "text"),

                      GetSQLValueString($_POST['received_pic'], "text"),

                      GetSQLValueString($_POST['model_number'], "text"),

                      GetSQLValueString($_POST['serial_number'], "text"),

                      GetSQLValueString($_POST['capacity'], "text"),

                      GetSQLValueString($_POST['confirmation_id'], "text"),

                      GetSQLValueString($_POST['order_id'], "int"));

 

All is fine, works as is.  My question is I want to add another field to update (a timestamp field), I’m no sure how GetSQLValueString() works with dates. DO I use the following?

 

GetSQLValueString($received_date,"date"),

 

Link to comment
https://forums.phpfreaks.com/topic/50023-getsqlvaluestring-function-question/
Share on other sites

  • 2 months later...

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.