Returns the number of columns from a select statement.
int obj_num_fields ( void )
Unsigned integer or -1 on failure.
<?php
try
{
$rs = $dbh->obj_select( "mytable" );
if ( $dbh->obj_error() )
throw new Exception( $dbh->obj_error_message() );
echo $rs->obj_num_fields();
}
catch ( Exception $e )
{
//log error and/or redirect user to error page
}
?>
See also: obj_affected_rows, obj_num_rows, obj_row_count