Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Variables within query

Author  Topic 

Hikaru Kagi
Starting Member

1 Post

Posted - 2012-04-09 : 18:34:20
Hi, I'm having a bit a trouble with this code:
$sql = "INSERT INTO comments (comment, time, user)
VALUES
('$_POST[message]', "$username", "$time")";
and the error code I get is "Parse error: syntax error, unexpected T_VARIABLE" this is probably a no brainer for you all, but I'm stumped.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-04-10 : 10:54:39
This is a string concatenating problem in PHP and no SQL problem.
Please try it in a PHP forum.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -