Ok, so I understand why this is printing, but I don't want it to print out to the page, instead I need this to to hide, and allow me to get only the name values
public function select($table,$options,$where,$orderby)
{
$options = empty($options) ? "*" : $options;
$where = empty($where) ? "1=1" : $where;
$orderby = empty($orderby) ? "" : $orderby;
$qry = "SELECT $options FROM $table WHERE $where $orderby ";
//print $qry;
$result = mysql_query($qry) or die(json_encode(array("error",mysql_error())));
while(($row = mysql_fetch_assoc($result))){ $resultArray[] = $row; }
return count($resultArray) < 1 ? print "[".json_encode(array("error"=>"sorry"))."]" : print json_encode($resultArray);
}
I use the following on the index.php page to get this information (using another function)
$menu = json_decode($fetch->menu('1'));
foreach ( $menu as $json )
{
echo $json['name']."
";
}