I am trying to run a database query as below:
$id = $_GET['id'];
$query = 'select * from ';
$query .= $wpdb->get_blog_prefix() . 'fxdescription ';
$query .= 'where id= '.$id;
$currency = $wpdb->get_results( $wpdb->prepare( $query ), ARRAY_A );
The result of doing print_r($currency) is as below:
Array (
[0] => Array ( [id] => 1 [code] => EUR [name] => Euro [description] => [format] => direct )
)
The question is - is the above result normal, as the result is an array inside an array, and to access the data I have to use $currency['0']['code'], in place of $currency['code']?
echo '<pre>' . print_r( $currency, true) . '</pre>'to get an easier to read output. – brasofilo Nov 18 '12 at 11:32