开发者

Update in time in MySQL is not working

开发者 https://www.devze.com 2022-12-13 14:36 出处:网络
I am trying to insert date time on the MySQL DB. I have kept the field as VARCHAR(9182开发者_JAVA百科)

I am trying to insert date time on the MySQL DB. I have kept the field as VARCHAR(9182开发者_JAVA百科)

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号