Skip to content
Extraits de code Groupes Projets
Valider 63f5a1ca rédigé par esj's avatar esj
Parcourir les fichiers

Retourner 0 pas NULL dans sql_countsel (Camille).

parent ca191f74
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -493,7 +493,8 @@ function spip_mysql_countsel($from = array(), $where = array(),
$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
$r = spip_mysql_select("COUNT($c)", $from, $where,'', '', $limit,
$having, $serveur, $requeter);
if (!$r OR !$requeter) return $r;
if (!$requeter) return $r;
if (!$r) return 0;
list($c) = mysql_fetch_array($r, MYSQL_NUM);
mysql_free_result($r);
return $c;
......
......@@ -541,8 +541,10 @@ function spip_pg_countsel($from = array(), $where = array(),
{
$c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby)));
$r = spip_pg_select("COUNT($c)", $from, $where,'', '', $limit, $having, $serveur, $requeter);
if ($r && $requeter) list($r) = pg_fetch_array($r, NULL, PGSQL_NUM);
return $r;
if (!$requeter) return $r;
if (!$r) return 0;
list($c) = pg_fetch_array($r, NULL, PGSQL_NUM);
return $c;
}
// http://doc.spip.org/@spip_pg_count
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter