Re: simple odbc/insert problem

From: Date: Mon, 20 Aug 2001 15:12:23 +0000
Subject: Re: simple odbc/insert problem
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-8954@lists.php.net to get a copy of this message
just found the php.db group... wrong place... sorry "Londonvibe" <dude@nospam.com> wrote in message news:20010820150835.27942.qmail@pb1.pair.com... > new to php so be nice :) > > win2k.... iis5.....ms access.. > > what is the order for adding var's to a access DB ?? > i can read data form the DB ok.. even print it out in a nice table :)... but > not sure how i write to the DB... it's driving me mad... any help or faq's > would be cool... > > code i tried... with data from form don't work... > > // connect to system dsn odbc name login and password or die > $connect = odbc_connect("DB","name","pword") or die (" not > connected"); > > $sql="INSERT INTO basket (Item,Amount,Price) Values > ('$id','$amount','$price')"; > // prepare SQL statement > //$sql_prepare = odbc_prepare($connect,$sql) or die("Couldn't prepare > query."); > // prepare SQL statement > $sql_result = odbc_prepare($connect,$sql) or die("Couldn't prepare query."); > > // execute SQL statement and get results > odbc_execute($sql_result) or die("Couldn't execute statement1."); > > odbc_free_result($sql_result); > odbc_close($connect); > > >

« previous php.windows (#8954) next »