I have this code
public function getList()
{
$array = array();
$r = mysql_query( "SELECT * FROM hobby ORDER BY hobby_name ASC" );
while( $ro = mysql_fetch_object( $r ) )
{
array_push( $array , $ro );
}
if ( count( $array ) > 0 )
return $array;
else
return false;
}
And was wondering if there is an easier way of doing this?
This code first gets all out of the database, pushes it into anarray, checks its count and returns the array or false.
When I get it into my $array I need to make foreach to this object to pase it.