I think I'm going mad, but query is not returning any values, only nulls.
The query is fine and works fine in phpmyadmin, so the implementation must be off? Or it's a bug?
Any takers?
The query is fine and works fine in phpmyadmin, so the implementation must be off? Or it's a bug?
Any takers?
Code:
SELECT SUM( colCount ) AS re
FROM (
SELECT COUNT( colPage ) AS colCount
FROM browserData b
GROUP BY colPage
ORDER BY colCount DESC
LIMIT 0 , 2
)table1
Code:
private function selectQuery($query)
{
$statement = $this->_connection->prepare($query);
if($statement == null)
{
die("Bad SQL Statement");
}
$statement->execute();
$meta = $statement->result_metadata();
while ($field = $meta->fetch_field())
{
$params[] = &$row[$field->name];
}
call_user_func_array(array($statement, 'bind_result'), $params);
while ($statement->fetch())
{
echo '<br/><br/><br/>';
foreach($row as $key => $val)
{
echo 'Field:' . $key . '<br/>';
$c[$key] = $val;
}
$result[] = $c;
}
$statement->close();
return $result;
}