Budaum Budaum Budaum
I'm having problems to access the columns from an executed query with the function MetabaseQueryAll.
Here is the code:
$query = "SELECT 1 as num";
MetabaseQueryAll($database, $query, &$all);
When I try to access the column num ( $all['num'] ), I can't, I can access it only through $all.
Is there some way to get the association names instead the column with this class? -> like mysql_fetch_assoc() function
I need to access the results through an associative array.
|2010-07-29 04:05:18 - In reply to message 1 from Budaum Budaum Budaum|
|You can pass an array of types of columns and it will return associative arrays for the result rows. You do not even need to use the AS clause to make the server give a different name to the columns:|
$query = "SELECT name from table";
$types = array(
MetabaseQueryAll($database, $query, $all, $types);