Re: Inserting into Interbase DB

From: Date: Thu, 12 Oct 2000 22:01:10 +0000
Subject: Re: Inserting into Interbase DB
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3569@lists.php.net to get a copy of this message
Todd Cary <todd@aristesoftware.com> wrote: > With the syntax below, the insert is not commited. What have I missed? > > Todd > > function insert_session($dbhdl, $ID) { > $statemt = 'INSERT INTO SESSIONS (SES_SESSION_ID) VALUES(' . $ID . > ')'; > $sthdl = ibase_query($statemt,$dbhdl); > }; Your syntax is ok and should do the job. The only thing is that you have exchanged the order of $statement and $dbhandle, but this is only critical if there is more than one open db connection in your script. Try it with $sthdl = ibase_query($dbhdl,$statemt) or die(ibase_errmsg()); that you don't miss the error message if an error occurs. If you are trying to access the inserted session_id on the same page add a call to ibase_commit() after the ibase_query(). Lutz -- ibWebAdmin 0.2alpha *** web-based InterBase database administration *** download the latest version from http://home.knuut.de/lb/ ***

« previous php.db (#3569) next »