Jump to content

[SOLVED] Including a timestamp in update?


chrisuk

Recommended Posts

I'm trying to code an update script to store the current time so that this can then be seen by the user the next time they look at that particular record.

 

The code for the script is as follows:

 

<?php

 

include("config.php");

 

$updatetime = date("j M y, G:ia");

 

//code to update record if any changes are made

$sql = "UPDATE Issues SET issue_desc = '$_POST[issue_desc]' , last_update = $updatetime WHERE issue_id='$_GET[issue_id]'";

 

$result = mysql_query($sql)or die("error");

 

?>

 

This produces simply "error" for this code.

 

However if I do not try to write $updatetime to the database, the query executes and issue_desc is updated.

 

Can anybody tell me what i'm doing wrong here?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/39314-solved-including-a-timestamp-in-update/
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.