$deger = select * from tablo where ip='127.0.0.1';
$oran = mysql_num_rows($deger);
if($oran<10)
{
db ekleyebilir
}
else
{
db ekleyemez..
}