tags:

views:

30

answers:

2

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

+2  A: 

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.

wallyk
A: 

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.

Don