Codice PHP:
<?
require ("core/config.inc.php");
require ("core/function.inc.php");
$db=connetti($dbhost, $dbuser, $dbpass, $dbname);
$query="SELECT * FROM card";
$result=mysql_query($query,$db) or die (mysql_error());
while($row=mysql_fetch_array($result)){
$lista2.="<option value=\"$row[id]\">$row[nome]</option>";
}
disconnetti($db);
switch($action){
case 'go':
$idd = $_POST['nome_card'];
$numero=trim($_POST['numero']);
$db=connetti($dbhost, $dbuser, $dbpass, $dbname);
$query="SELECT * FROM card";
$result=mysql_query($query,$db) or die (mysql_error());
while($row=mysql_fetch_array($result)){
if ($idd == ($row[id]))
{
$query="UPDATE card SET id='".$row['id']."', nome='".$row['nome']."', descr='".$row['descr']."', equip='".$row['equip']."', num='".$numero."' where ID='".$idd."';";
mysql_query($query,$db) or die ("Query eseguita:" . $query . '<BR>' . mysql_error());
}
}
break;
}
disconnetti($db);
eval("Stampa(\"".GetTemplate("tpl/admin.htm")."\");");
?>
boh...