Re: [PHP3] oracle8: correct date insert??

From: Date: Fri, 23 Jun 2000 00:59:59 +0000
Subject: Re: [PHP3] oracle8: correct date insert??
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-567@lists.php.net to get a copy of this message
hi friend try the following : for insert date $Today = date("d-m-Y H:i:s"); $sql="insert into orders(ORDER_ID, ORDER_DATE) values(".$OrderID.", to_date('$Today', 'DD MM YYYY HH24 MI SS'))"; $stmt=ociparse($connection,$sql); $orderinsert = OCIExecute($stmt, OCI_DEFAULT); for get it out $sql="select ORDER_ID, to_char(ORDER_DATE,'DD-MM-YYYY HH24:MI:SS') ORDER_DATE from orders "; ^ | this is a variable name hope this help M ----- Original Message ----- From: Dieter Kneffel <data@wap4.com> To: <php3@lists.php.net>; php-db <php-db@lists.php.net> Sent: Tuesday, June 20, 2000 11:02 PM Subject: [PHP3] oracle8: correct date insert?? > help, please: What is the proper format to perform an insert > of date and time information into a date field using oracle8. > > the following just does not work: 'insert into my_table ( my_date_field > )VALUES( '2000-06-20 12:05:01') > using other notation, e.g. slashes (01/01/2000) nstead of minus (as > above) works, but only on dates. > I am not able to insert date and time! the my_date_field is simply > defined as 'date' > In some manuals, I have seen a notion like ... TO_DATE() where you have > to supply the date/time as > an integer and give formatting information. Is this the only way? > > Please give me an example! > > thanks, > > dieter > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net > To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#567) next »