Returns a resultset as an associative array.
mixed obj_fetch_assoc ( void )
Array or null if no more rows.
<?php
try
{
$rs = $dbh->obj_select( "mytable", "color,size,price", "product='balloons'", "price" );
if ( $dbh->obj_error() )
throw new Exception( $dbh->obj_error_message() );
while ( $rs->obj_fetch_assoc() )
{
printf ( "%s %s %s \n", $rs->obj_field( "color" ),
$rs->obj_field( "size" ),
$rs->obj_field( "price" );
}
echo $rs->obj_num_rows();
$rs->obj_free_result();
}
catch ( Exception $e )
{
//log error and/or redirect user to error page
}
?>
See also: obj_fetch_num, obj_fetch_object