Hi all,
I have a strange situation. I'm trying to update the values in some table of my db.
The query was ok up to i created a table named div. Now the query works for all the tables except 'div' table. Is it possible that the table name is not useable ?
the code is:
# apro database
include "connDB.php";
#---------------------------------------------------------------------------------------------------------------
$queryETF = mysql_query("SELECT codBorsa FROM etf_it ", $pntDB);
while($dati = mysql_fetch_array($queryETF)) {
$codBorsa=strtolower(stripslashes($dati['codBorsa']));
# creo le tabelle _close
$queryNAV="SELECT * FROM ".$codBorsa;
$resultNAV = mysql_query($queryNAV, $pntDB);
if ( !$resultNAV){
$sqltabNAV = "CREATE TABLE IF NOT EXISTS ".$codBorsa."_close (Close_Data datetime default NULL ,Close_Val double default NULL ,Close_Vol int( 11 ) default NULL) ";
$resulttabNAV = mysql_query($sqltabNAV, $pntDB);
// controllo l'esito
if (!$resulttabNAV) {
die("Errore nella query " . mysql_error());
} else {
echo "Inserita tabella ".$codBorsa."_close <br />";
}
# creo le tabelle etf dove mettere i nav
$queryClose="CREATE TABLE ".$codBorsa." (Data datetime default NULL ,Valore double default NULL ,Dividendo double default NULL ,VarDay double default NULL ,
Quote double default NULL ,Nav_modificato double default NULL ,VarDayMod double default NULL)";
$resultClose = mysql_query($queryClose, $pntDB);
// controllo l'esito
if (!$resultClose) {
die("Errore nella query " . mysql_error());
} else {
echo "Inserita tabella ".$codBorsa." <br />"
}
}
}
?>