Re: [phplib] test for database SQL success or failure From: Horatio B. Bogbindero (wyy <email protected>)
Date: 03/13/01

>
> I'm looking for a way to test whether or not a call to phplib query
> function has succeeded or failed.
>
> if i call the 'query' function ie. $db->query( "SQL" );
>
> what can I do next to test the "pass" or "fail" of the SQL statement.
>
$res = $db->query("SELECT * FROM mytable");
if ($res== 0) {
        echo "FAILED.<BR>\n";
} else {
        echo "SUCCESS resource id =" . $res ."<BR>\n";
}

--------------------------------------
William Emmanuel S. Yu
Ateneo Cervini-Eliazo Networks (ACENT)
email : william.s.yu <email protected>
web : http://cersa.admu.edu.ph/
phone : 63(2)4266001-5925/5904
 
... and furthermore ... I don't like your trousers.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>