Buongiorno a tutti e grazie per il vostro aiuto.
obiettivo: far passare dal form il nome univoco per la tabella che vado a creare in sql
questo il codice del form:
Codice PHP:
<form action="create_table.php" method="post">
<div align="center">
<table width="900" border="0">
<tr>
<th scope="col"><div align="left"></div></th>
</tr>
</table>
</div>
<div align="center">
<table width="902" border="0" background="back_fidelity.png" repeat="norepeat">
</p></th>
<th scope="col">
</p>
</p>
</p></th>
<th scope="col"></th>
<th width="469" rowspan="10" scope="col">
</p>
</p></th>
</tr>
<tr>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
<tr>
<th width="33" height="83" scope="col"></th>
<th width="183" scope="col"><div align="left">[b]Create TB:[/b]</div></th>
<th width="192" scope="col"> <div align="center">
<input type="text" name="CODE" />
</div></th>
</tr>
<tr>
<td height="110"></td>
<td></td>
<td><div align="center">
<input type="submit" />
</div></td>
</tr>
</table>
</div>
</form>
QUESTO IL FILE PHP X LA CREAZIONE DELLA TABELLA:
Codice PHP:
<?php
$con = mysql_connect("localhost","XXXXXXXX","XXXXXXXX");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Create table
mysql_select_db("raffaele_loyalty_card", $con);
$sql = "CREATE TABLE [COLOR=skyblue]QUI DEVO FAR PASSARE IL NOME DELLA TABELLA DAL FORM[/COLOR]
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
mysql_query($sql,$con);
mysql_close($con);
?>
COME FACCIO? GRAZIE IN ANTICIPO
RAFFAELE