Re: [MySQL] Query syntax error?
Posted: Sun Feb 10, 2008 1:13 pm
The structure is irrelevant because it's for a pagination class which should work on every single database.astions wrote:The logic of your query is way off and it's missing aliases. Post your table structure and what your trying to accomplish.
I solved it like this:
Code: Select all
if (empty($group))
{
$dbRCount = $db->get_var("SELECT COUNT(*) AS total $from $where");
}
else // Multiple rows will be returned
{
$dbRCount = count($db->get_col("SELECT COUNT(*) AS total $from $where $group"));
}