Date: 03/13/01
- Next message: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Previous message: Tiong Kee Yong: "RE: [phplib] test for database SQL success or failure"
- Next in thread: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Reply: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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.
Depending on the circumstances
if($db->num_rows()) { ... }
or
if($db->next_record()) { ... }
You could also use a preliminary query to find the number of matching rows.
$db->query("select count(*) from table where ...");
$db->next_record();
if($db->f(0)) { ... }
Layne Weathers
Ifworld, Inc.
layne <email protected>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Previous message: Tiong Kee Yong: "RE: [phplib] test for database SQL success or failure"
- Next in thread: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Reply: Howard Ha: "RE: [phplib] test for database SQL success or failure"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

