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 )"; } ?> Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/ Share on other sites More sharing options...
darkfreaks Posted November 30, 2008 Share Posted November 30, 2008 nevermind Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702079 Share on other sites More sharing options...
Akenatehm Posted November 30, 2008 Author Share Posted November 30, 2008 Ok... Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702082 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? Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702118 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 Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702125 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 )"; } ?> Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702143 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. Link to comment https://forums.phpfreaks.com/topic/134824-solved-unexpected-t_string/#findComment-702667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.