I need to get an object $resultInput to be viewed as an array (like $resultInput commented out). However when I use the function object to array I get an error Resource id #5. What is the issue?
require('dbc.php');
mysql_select_db($db);
$resultInput = mysql_query("SHOW COLUMNS FROM about WHERE Field NOT IN ('id', 'created', 'date_modified', 'last_modified', 'update', 'type', 'bodytext') AND Field NOT REGEXP '_image'"); // selects only the columns I want
//$resultInput = array('page_header', 'sub_header', 'content', 'content_short');
function objectToArray($object){
if(!is_object($object) && !is_array($object)){
return $object;
}
if(is_object($object)){
$object = get_object_vars( $object );
}
return array_map( 'objectToArray', $object );
}
// convert object to array
$array = objectToArray( $resultInput );
//show the array
print_r( $array );