jim.davidson Posted May 4, 2007 Share Posted May 4, 2007 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 More sharing options...
keeB Posted July 14, 2007 Share Posted July 14, 2007 Don't do that $updatedDate = now(); $destroyed = $_POST["destroyed"]; . . . . $q = "UPDATE orders SET destroyed = '$destroyed', ... "; $result = mysql_query($q); ^ much much much easier to read Link to comment https://forums.phpfreaks.com/topic/50023-getsqlvaluestring-function-question/#findComment-297937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.