update into timestamp

Codes here !

Moderators: macek, egami, gesf

jpbal
New php-forum User
New php-forum User
Posts: 4
Joined: Wed Feb 12, 2003 1:36 am

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

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

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!

jpbal
New php-forum User
New php-forum User
Posts: 4
Joined: Wed Feb 12, 2003 1:36 am

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

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

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

I think I didn't understand you...
Can you repeat the question please...
;)
ThanX


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron