What I am trying to do it create an Admin panel that will create a table in the database automatically. (Without having to go into phpmyadmin).
Is this possible, and howso?
Well, it depends on the level of customization you want.
It can be a simple matter of writing:
mysql_query("CREATE TABLE sometable(...)");
or it could involve something more complex.
What i want is a table with the value of $link, and to have one field for text named 'solved'.
This possible? 🙂
Hmm..This doesn't error, but it doesn't create the table either.. :S
<? $link = 'TestDB2'; $host = "localhost"; $login_name = "xxx"; $passwordx = "xxx"; $database = "memoryxchal"; MySQL_connect("$host","$login_name","$passwordx") or die("DURR ITS BROKEN"); MySQL_select_db("$database") or die("Could not select database"); mysql_query("CREATE TABLE '$link'(username varchar(30))"); ?>
It's not going to give you error messages unless you test for them. $sql = "CREATE TABLE $link (username varchar(30))"; mysql_query($sql); if (mysql_errno()) die(mysql_error());
What you are trying to do will work once you have the syntax correct.