Jump to content

[SOLVED] Unexpected T_STRING


Akenatehm

Recommended Posts

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

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
)";
}
  
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.