Re: [PHP-DB] Inserting into Interbase DB From: Lutz Brueckner (irie <email protected>)
Date: 10/12/00

Todd Cary <todd <email protected>> 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/ ***

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>