I have the following query in PHP:
$stmt = $conn->prepare('SELECT
date,
avg(sells) as sells
FROM `table` WHERE product_id = :id group by date having count(id) > 1');
$stmt->execute(array('id' => $product));
$res = $stmt->fetchAll(PDO::FETCH_ASSOC);
As expected this returns me:
array(2) {
[0]=> array(2) {
["date"]=> "2013-1-11" ["sells"]=> "73.5000"
}
[1]=> array(2) {
["date"]=> "2013-1-11" ["sells"]=> "77.0000"
}
}
Anyway I can get the following output without looping with php?
array(2) {
[0]=> array(2) {
"2013-1-11",
"73.5000"
}
[1]=> array(2) {
"2013-1-11",
"77.0000"
}
}