Impossibile eliminare!



"; echo "
"; echo ""; function Modifica($tabella, $id) { include("required.php"); $db = mysql_connect($ip, $user, $password); mysql_select_db($dataname,$db); echo "

Modifica $tabella

"; $criteri = "SELECT * FROM $tabella WHERE id = $id "; //echo $criteri; $result = mysql_query($criteri, $db); $myrow = mysql_fetch_array($result); $num_fields = mysql_num_fields($result); echo "
"; //$valori = array(); for($x = 0; $x < $num_fields; $x++) { //$tipo = ""; // Visualizza il tipo del campo $t = ereg_replace("'", "", $myrow[mysql_field_name($result, $x)]); // Rimozione delle stringhe del singolo apice $dati = $t; if ($riga == true) { echo ""; $riga = false; } else { echo ""; $riga = true; } if (mysql_field_type($result, $x) == "blob") //if (mysql_field_type($result, $x) == "blob" || mysql_field_len($result, $x) > 30 ) echo "$tipo"; else { if (strstr(mysql_field_name($result, $x), "id")) //echo "$tipo"; echo "$tipo"; else echo "$tipo"; } } echo ""; echo ""; echo "
".mysql_field_type($result, $x)."
".mysql_field_name($result, $x)."
".mysql_field_name($result, $x)."
$dati

"; echo "
"; } function Aggiorna($tbl, $id, $valori) { include("required.php"); $db = mysql_connect($ip, $user, $password); mysql_select_db($dataname,$db); $criteri = "SELECT * FROM $tbl "; //echo $criteri; $result = mysql_query($criteri, $db); $myrow = mysql_fetch_array($result); $num_fields = mysql_num_fields($result); $query = "UPDATE $tbl SET "; for($x = 0; $x < $num_fields-1; $x++) $query .= " ".mysql_field_name($result, $x)." = '".$valori[mysql_field_name($result, $x)]."',"; $query .= " ".mysql_field_name($result, $num_fields-1)." = '".$valori[mysql_field_name($result, $num_fields-1)]."'"; $query .= " WHERE id = $id "; //echo $query; $agg = mysql_query($query, $db); if (!$agg) echo "

Aggiornamento non effettuato!



"; } function Tabella($livello) { include("required.php"); $db = mysql_connect($ip, $user, $password); mysql_select_db($dataname,$db); $criteri = "SELECT * FROM $tbl_livelli WHERE livello = $livello"; //echo $criteri; $result = mysql_query($criteri, $db); if ($myrow = mysql_fetch_array($result)) return $myrow[tabella]; else return ""; } function Chiave($livello) { include("required.php"); $db = mysql_connect($ip, $user, $password); mysql_select_db($dataname,$db); $criteri = "SELECT * FROM $tbl_livelli WHERE livello = $livello"; //echo $criteri; $result = mysql_query($criteri, $db); if ($myrow = mysql_fetch_array($result)) return $myrow[chiave]; else return ""; } //echo "
"; echo ""; ?>