开发者

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开发者_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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜