potrebuji spocitat radky(zaznamy) v db u nichz je jedna polozka napr IP odpovida.
tedy kolik zaznamu s danou IP je v db.
vite nekdo prosim?
mam to takhle ale nefacha to :(
require_once("db_fns.php");
$ip= gethostbyname($REMOTE_ADDR);
@$conn = db_connect();
if (!$conn)
{
exit; //pripojeni nok - konec
}
@$result = mysql_query ("SELECT count(*) FROM hack WHERE ip = '$ip'");
if(!$result){exit;}
if (mysql_num_rows($result) > 10 )
{
{
Header ( "Location: hacking.php" );
}
exit;
}
$kolik = mysql_num_rows(mysql_query("SELECT ip FROM hack WHERE ip = '$ip'"));
echo $kolik;