Originariamente inviato da yitalia
$post = $_POST;
$ipcheeck = $post['ipcheeck'];
$query = "SELECT * FROM banning WHERE ip='$ipcheeck'";
$id = $query['id'];
$res = mysql_query($query);

if (mysql_num_rows($res) > 0)
{
echo "The IP $ipcheeck has beed detected in the bas list, with the ID: $id";}
else {echo " The IP $ipcheeck hasn't beed detected in the bas list.";}
mysql_close($connessione);
?>
campo: id (primary key)
campo: ip (indice)
io avrei fatto così
$query = "SELECT * FROM banning WHERE ip='$_POST['ipcheeck']";
$ris = mysql_query($query);
$row = mysql_fetch_row($ris);

$id = $row[0];
if (empty($id)){ echo "The IP $ipcheeck hasn't beed detected in the bas list.";}
else { "The IP $ipcheeck has beed detected in the bas list, with the ID: $id"; }

ciao daniele