Subject RE: [firebird-php] problems with ibase_free_result
Author Nigel Weeks
It may be that an result object is not returned from a delete operation...

I couldn't be certain, but it may be the reason.

if(ibase_query($db_session, $query)){
echo "Session deleted ok";
} else {
echo "Problems deleting session";
}


If you need feedback from a delete, there are a few methods:
(Slowest, ugliest code)
Get PHP to do a select for the row you just deleted - if it's gone, the
delete was successful
(Reasonable speed, more complexity)
Use a stored procedure to do the delete, then the check, and return a
success value to the top.
(Fastest, simplest)
get the number of rows affected(php5)
You should get one row - the session record you just deleted.

Nige.

> -----Original Message-----
> From: domanovic [mailto:marko@...]
> Sent: Tuesday, 19 October 2004 12:42 AM
> To: firebird-php@yahoogroups.com
> Subject: [firebird-php] problems with ibase_free_result
>
>
>
>
>
> My setup: PHP 5.0.2, Firebird 1.5
>
> I have some problems with ibase_free_result... It's something like:
>
> Warning: ibase_free_result(): supplied argument is not a valid
> Firebird/InterBase result resource in
> /opt/lampp/htdocs/klad/include_core/ibase_sessions.php.inc on line 180
>
> the function that is in question look like this:
>
> function ibase_session_destroy($sessionID) {
> global $sess_table;
> global $db_session;
>
> $query = "DELETE FROM $sess_table WHERE SID = '$sessionID'";
> $result = ibase_query($db_session, $query);
> ibase_free_result($result);
> ibase_commit();
> //return(true);
> } // end ibase_session_destroy()
>
>
> $db_session is global variable refering to database connection, it is
> opened in function
>
> function ibase_session_open($session_path, $session_name) { //cemu
> sluze ova dva argumenta?
> global $db_session;
> $db_session = ibase_connect(DBHOST, USER, PASS) or die("error in db
> connect");
> return(true);
> } // end ibase_session_open()
>
>
>
> I really can't see the problem, starting to think it's some kind of
> bug...... Please help!
>
> BTW, these days I worked on a custom firebird/interbase session
> handler in php... so if anyone is interested in these functions, I'll
> post them here, just ask for it...
>
>
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> $9.95 domain names from Yahoo!. Register anything.
> http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/PhFolB/TM
> --------------------------------------------------------------
> ------~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
> __________ NOD32 1.897 (20041018) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
>