Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

update into timestamp

Codes here !

Moderators: macek, egami, gesf

update into timestamp

Postby jpbal » Wed Feb 12, 2003 3:12 am

hello,
what is wrong?
$result=mysql_query("UPDATE tempo_best_mto SET t_best='$temp_orange$numeroLigne]', hu_best='$hu_orange[$numeroLigne]' WHERE id_depot='$id_depot'
AND num_site_mto='$num_site'
AND date_validite ='$date_validite[$numeroLigne]'");

The update is in fact INSERT with the current date-time
$date_validite[$numeroLigne]='20030212080000' for example
date_validite is a TIMESTAMP(14)
INDEX id_depot,num_site_mto,date_validite

How can i do that efficiently
thanks
jpbal
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Feb 12, 2003 1:36 am

Postby Joan Garnet » Wed Feb 12, 2003 4:08 am

Try this one:
Code: Select all
$result=mysql_query("UPDATE tempo_best_mto SET t_best = ".$temp_orange[$numeroLigne].", hu_best = ".$hu_orange[$numeroLigne]." WHERE id_depot == ".$id_depot." AND num_site_mto == ".$num_site." AND date_validite == ".$date_validite[$numeroLigne]);

Is one of the possible ways..

bye!
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

update

Postby jpbal » Wed Feb 12, 2003 5:01 am

hi,
sorry but no difference, they are INSERTION and not UPDATE with a date_validite=current date/time of my PC
jpbal
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Feb 12, 2003 1:36 am

Postby Joan Garnet » Wed Feb 12, 2003 2:22 pm

I think I didn't understand you...
Can you repeat the question please...
;)
ThanX
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.