jenny


>suppose I have added one field time_stamp of type
>timestamp in any existing table. it will show the
>current timestamp of all records. If i update any
>record after sometime It will also update the
>timestamp of updated record with current timestamp.
>
>but for insertion of any record...what i have to
>do...i have to mention the current timestamp value
>with values of all fields of a record or is there any
>way to insert new record so that it will automatically
>take current timestamp for that record.
>
>Plz specify the sql query also, if u know right now.




$sql = "insert into ctnt_inf (cat_id, lang_id, memb_id,  firstName, 
lastName, title, body,summary,date_time, day, month, year ) " .

"values (" . $cat_opt_name . "," . $lang_opt_name . ", " . $memb_id[0]. ",'" 
. $firstName . "', '" . $lastName . "','" . $title . "','" . $body . "','" . 
$summary . "'," . time() . ", " . date("d"). ", " . date("m"). ", " . 
date("Y"). " ) ";


this is my perfectly workin queryit inserts the timestamp along with all the 
other fields .... perfect ! !! !


hope it hlps ....

good luck ....

toby .....





_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to