![]() |
php timestamp newbie question
ok i inserted a timestamp row and when i insert a new query manually from phpadmin it appears correctly. what command do i use for:
$sqlquery = "INSERT INTO $table VALUES( '".mysql_insert_id()."',' 1',' ???????????',' ',' ',' ',' ???????????',' is where the timestamp command should go |
you dont put anything in the timestamp. It will update automaticly when you update the record. So you leave that field empty. ( doesnt matter what you put there, it wont be accepted. )
|
Was that field defined as a TIMESTAMP field? If so, then setting it to NULL will load it with the current time. You CAN set it to a specific value and it also updates every time the row is updated.
|
thats what i thought but i tried a test transaction and it showed up as "00000000000000"
|
yes it was put as NULL, when I update something via phpmyadmin it is fine, but when i insert it using the code in the 1st post, it shows up as all 0's
|
$sqlquery = "INSERT INTO $table
VALUES( '".mysql_insert_id()."',' 1',' ',' ',' ',' ',' the bold part shows the third row (timestamp) |
ok nevermind, i see that when you update the transaction it changes. my program updates it before I need the timestamp anyways. Thanks!
|
All times are GMT -7. The time now is 07:03 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123