Ragazzi sto diventando matto,da un link mi connetto a una pagina php che richiama questa funzione di delete utente quindi questo codice che leggerete qui sotto confronterà la stringa di uid(è un campo di 32 caratteri creato random) e se presente mi cancellerà l'utente dal sui id utente il problema è che mi fa la cancellazione tranquillamente però come messaggio mi restituisce sempre REG FAILED
Cosa sbaglio??
Codice PHP:
function reg_delete($id){
$table= 'utenti';
$numero=$GET['id'];
$words = split(" ", $_GET ['id']);
$Query = "SELECT * FROM ".$table." WHERE 1=1 ";
foreach($words as $word)
{
$Query .= " AND uid LIKE '%$word%' ";
}
$result = mysql_query($Query);
while ( $rw = mysql_fetch_assoc( $result ) ) {
$utente=$rw["id"];
$nickname=$rw["username"];
$userid=$rw['uid'];
}
$strSQL = "DELETE FROM utenti WHERE $utente = id";
mysql_query($strSQL) OR die("Errore 003, contattare l'amministratore ".mysql_error());
if (mysql_affected_rows () != 0) {
echo "tutto apposto trovato";
return REG_SUCCESS; }
else { echo 'nessuna corrispondenza trovata' ;
return REG_FAILED;}
}