![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
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. )
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
thats what i thought but i tried a test transaction and it showed up as "00000000000000"
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
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
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
$sqlquery = "INSERT INTO $table
VALUES( '".mysql_insert_id()."',' 1',' ',' ',' ',' ',' the bold part shows the third row (timestamp) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
ok nevermind, i see that when you update the transaction it changes. my program updates it before I need the timestamp anyways. Thanks!
|
![]() |
![]() ![]() ![]() ![]() ![]() |