Skip to content
Snippets Groups Projects
Commit 70f90edb authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #6390 change select * by select count(1) and remove rowCount()

parent ea0bad5a
No related branches found
No related tags found
No related merge requests found
......@@ -31,16 +31,16 @@ for ($i=0;$i<count($_SESSION['user']['baskets']);$i++) {
if ($_SESSION['user']['baskets'][$i]['id'] == $basketId) {
if (!empty($_SESSION['user']['baskets'][$i]['table'])) {
if (trim($_SESSION['user']['baskets'][$i]['clause']) <> '') {
$stmt = $db->query('select * from '
$stmt = $db->query('select count(1) as nb from '
. $_SESSION['user']['baskets'][$i]['view']
. ' where ' . $_SESSION['user']['baskets'][$i]['clause']);
$nb = $stmt->rowCount();
$res = $stmt->fetchObject();
}
}
}
}
echo json_encode(['status'=>1, 'nb'=>$nb, 'idSpan'=> functions::xssafe($_REQUEST['id_basket']), 'id_basket'=> functions::xssafe($basketId)]);
echo json_encode(['status'=>1, 'nb'=>$res->nb, 'idSpan'=> functions::xssafe($_REQUEST['id_basket']), 'id_basket'=> functions::xssafe($basketId)]);
exit;
$sessionTemplateContent = trim(str_replace(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment