On Thu, 24 Nov 2005 13:55:48 +1100, Steve Baldwin wrote:

Hi Steve

That's good to know. I won't use that, though, in V 1.00. Here's the context
(pinched from the Postgres driver):

if ($sth->fetchrow_array() )
{
                _run_sql($dbh, 'update ' . $self -> table_name() . ' set 
a_session=? where
id=?', $datastr, $sid)                  or return $self -> set_error("store(): 
serialize to db
failed " . $dbh->errstr() );    
}
else
{
                _run_sql($dbh, 'insert into ' . $self -> table_name() . ' 
(a_session, id)                                       
values(?, ?)', $datastr, $sid)                  or return $self -> 
set_error("store():
serialize to db failed " . $dbh->errstr() );    
}

and

sub _run_sql
{
        my($dbh, $sql, $datastr, $sid) = @_;
        eval
        {
                my($sth) = $dbh -> prepare($sql) or return 0;
                $sth -> bind_param(1, $datastr) or return 0;
                $sth -> bind_param(2, $sid) or return 0;
                $sth -> execute() or return 0;
        };
        return 0 if $@;
        return 1;
}       # End of _run_sql.
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html


Reply via email to