Create table in mysql
Posted: Wed Aug 15, 2007 2:20 pm
How can I create a table in mysql, like this:
and make the table (where it says DB_NAME_HERE) the variable $dbname from this code:
To have that ($dbname) the table name?
Thanks!
Code: Select all
$sql = 'CREATE TABLE `DB_NAME_HERE` ('
. ' `topic` varchar(65) NOT NULL default \'\','
. ' `message` varchar(65) NOT NULL default \'\','
. ' `datetime` varchar(65) NOT NULL default \'\','
. ' `sender` varchar(65) NOT NULL default \'\','
. ' PRIMARY KEY (`topic`)'
. ' ) TYPE=MyISAM AUTO_INCREMENT=0 ';Code: Select all
$username=$_POST['username'];
$password=$_POST['password'];
$email=$_POST['email'];
$dbname=$_POST['dbname'];Thanks!