GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php timestamp newbie question (https://gfy.com/showthread.php?t=559981)

mkx 01-04-2006 01:28 AM

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

grumpy 01-04-2006 01:32 AM

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. )

Tempest 01-04-2006 01:35 AM

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.

mkx 01-04-2006 01:36 AM

thats what i thought but i tried a test transaction and it showed up as "00000000000000"

mkx 01-04-2006 01:37 AM

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

mkx 01-04-2006 01:39 AM

$sqlquery = "INSERT INTO $table
VALUES(
'".mysql_insert_id()."','
1','
','
','
','
','

the bold part shows the third row (timestamp)

mkx 01-04-2006 01:42 AM

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