objSQL General Queries
The obj_query() method executes general queries and is called from the objSQL class.
- The $query argument is required.
Returns: Result resource/object or false on failure.
<?php
//usage: $dbh->obj_query( $query )
try
{
$rs = $dbh->obj_query( "select prod_id from mytable where color='blue' and product='balloon'" );
if ( $dbh->obj_error() )
throw new Exception( $dbh->obj_error_message() );
echo $rs->obj_num_rows();
}
catch ( Exception $e )
{
//log error and/or redirect user to error page
}
?>