Akenatehm Posted November 30, 2008 Share Posted November 30, 2008 Hey Guys, Here's the error: Parse error: syntax error, unexpected T_STRING in /home/kaurlcom/public_html/messenger/createtable.php on line 15 and the code: <?php include "connect.php"; $author=$_POST['author']; $random=$_POST['random']; $insert = "INSERT INTO `chatrooms` (author,time) VALUES ($author,$random)"; $result= "SELECT `chat_id` FROM chatrooms where random = $random AND author = $author"; while($row = mysql_fetch_array($result)) { $create = "CREATE TABLE "chat_"'$result'"" ( username text, message text )"; } ?> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted November 30, 2008 Share Posted November 30, 2008 nevermind Quote Link to comment Share on other sites More sharing options...
Akenatehm Posted November 30, 2008 Author Share Posted November 30, 2008 Ok... Quote Link to comment Share on other sites More sharing options...
KrisNz Posted November 30, 2008 Share Posted November 30, 2008 What are you trying to do with this exactly? Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted November 30, 2008 Share Posted November 30, 2008 Your quotes are out of whack in the CREATE statement Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 30, 2008 Share Posted November 30, 2008 Try this buddy! <?php include "connect.php"; $author=$_POST['author']; $random=$_POST['random']; $insert = "INSERT INTO `chatrooms` (author,time) VALUES ($author,$random)"; $result= "SELECT `chat_id` FROM chatrooms where random = $random AND author = $author"; while($row = mysql_fetch_array($result)) { $create = "CREATE TABLE `chat_{$result}` ( username text, message text )"; } ?> Quote Link to comment Share on other sites More sharing options...
Akenatehm Posted December 1, 2008 Author Share Posted December 1, 2008 Thanks for your help again The Little Guy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.