<?php
include ("tabstile.php");
include ("config.php"); 
         
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase"); 

$query = "update $tabgroup  set 
nome='$nome',agggr='$agggr' where 
nome='$nome'";
$result = mysql_db_query("$dbname", $query);
$query = "select * from $tabgroup  "; 
$result = mysql_db_query("$dbname", $query);
if ($result) { 

 

while ($r = mysql_fetch_array($result)) { 
$nome = $r["nome"];

$agggr = $r["agggr"]; 

echo ""; 
} 
 
} else {
 
 $query = 'CREATE TABLE  IF NOT EXISTS '. $tabgroup .'  ('
        . ' `nome` VARCHAR(30), '
        . ' `agggr` LONGTEXT '
        . ' )';   
 $result = mysql_db_query("$dbname", $query);
 
$query = "insert into ". $tabgroup ." values ('$nome','$agggr')";
$result = mysql_db_query("$dbname", $query);

echo "";
 
} 
echo "<p>Hai aggiornato/creato $tabgroup : $agggr</p>";


?>



 
