par
zeus » 17 nov. 2005, 14:05
Encore mieux, avec implode, il construit la liste automatiquement à partir du tableau
<?php
$exclure = array("201.234.223.234",
"32.332.112.234",
"55.355.234.123");
$str_exclure = implode(", ", $exclure);
$sql = "SELECT COUNT(*) AS stat ".
"FROM logs ".
"WHERE page='/tutorat/firefox/quebec.php'
AND ip NOT IN ('.$str_exclure.')";
$retour1 = mysql_query($sql);
?>
Encore mieux, avec implode, il construit la liste automatiquement à partir du tableau
[php]<?php
$exclure = array("201.234.223.234",
"32.332.112.234",
"55.355.234.123");
$str_exclure = implode(", ", $exclure);
$sql = "SELECT COUNT(*) AS stat ".
"FROM logs ".
"WHERE page='/tutorat/firefox/quebec.php'
AND ip NOT IN ('.$str_exclure.')";
$retour1 = mysql_query($sql);
?>[/php]