Skip to content

Problem when I update the class (currently 2.4) to 2.6,2.5 or the 2.4 version hosted here #388

Closed
@weha

Description

@weha

When I update to the new version I get an error: Problem preparing query
Not everywhere so it is a specific problem.
The query that it spat out works fine in phpmyadmin and it works with a previous version of the class.

Does not work:

// count the pages
$count = $dbi->copy();
$count = $count->getValue('companies',"COUNT(companies.id)");
$count = ceil($count / $itemsperpage);
Lastquery: SELECT COUNT(companies.id) AS retval FROM companies LIMIT 1
// active
$temp = $dbi->copy();
$temp->where('companies.active',1);
$active = $temp->getValue("companies","count(companies.id)");
Error: 'Problem preparing query (SELECT count(companies.id) AS retval FROM companies WHERE companies.active = ? LIMIT 1)

Does not work either:

// count the pages
$count = $dbi->copy();
$count = $dbi->getValue('companies',"COUNT(companies.id)");
$count = ceil($count / $itemsperpage);
// active
//$temp = $dbi->copy();
$dbi->where('companies.active',1);
$active = $dbi->getValue("companies","count(companies.id)");

Error: 'Problem preparing query (SELECT count(companies.id) AS retval FROM companies WHERE companies.active = ? LIMIT 1) '

works

// count the pages
//$count = $dbi->copy();
$count = $dbi->getValue('companies',"COUNT(companies.id)");
$count = ceil($count / $itemsperpage);
Lastquery: SELECT COUNT(companies.id) AS retval FROM companies LIMIT 1
// active
$temp = $dbi->copy();
$temp->where('companies.active',1);
$active = $temp->getValue("companies","count(companies.id)");
Lastquery: SELECT count(companies.id) AS retval FROM companies WHERE companies.active = '1' LIMIT 1

Also works

// count the pages
//$count = $dbi->copy();
//$count = $count->getValue('companies',"COUNT(companies.id)");
//$count = ceil($count / $itemsperpage);
// active
$temp = $dbi->copy();
$temp->where('companies.active',1);
$active = $temp->getValue("companies","count(companies.id)");

For testing: Above this code, no where or anything as been set, there have been other queries though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions