php - Postegre sql update statement quotes issue
870
Im attempting to update a last access time in my database the problem im having is that im using postgres sql and for the strings I must use double quotes inside of single quotes, however this is throwing off the statement, is there a way to get around this
$sql= "UPDATE users SET last_access=' .date("Y-M-D", time ()).' WHERE login_id= '" .$login. "'";
pg_query($conn, $sql);
Answer
Solution:
or easier and cleaner using Postgresql's date: