NewDev
NewDev

Reputation: 109

Update in time in MySQL is not working

I am trying to insert date time on the MySQL DB. I have kept the field as VARCHAR(9182)

date_default_timezone_set('Asia/Kolkata');
$timestamp =  date("m/d/Y h:i:s a", time());    

$utimeprocess = "UPDATE tabelconf 
                    SET time_of_pstart = '".mysql_escape_string($timestamp)."' 
                  WHERE UniqueID = '".mysql_escape_string($dbUniqueID)."'";

$result = mysql_query($utimeprocess);

return of $result is 1

Upvotes: 0

Views: 92

Answers (2)

Don
Don

Reputation: 4673

And if you

"Select time_of_pstart from tabelconf WHERE UniqueID = ".mysql_escape_string($dbUniqueID) "'";

Does it return what you expect? An update will succeed if runs, not only if it updates.

Upvotes: 0

wallyk
wallyk

Reputation: 57784

This means it succeeded. From the documentation:

For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.

Upvotes: 2

Related Questions