Jump to content

[SOLVED] Can't figure out why I'm getting parse error unexpected T_VARIABLE


pneudralics

Recommended Posts

Parse error: syntax error, unexpected T_VARIABLE

 

The error is on the 1st line below. Can't seem to figure out what's wrong with the below. Looks like I'm following the correct syntax.

								
$insertsigns = "INSERT INTO temp (userid, title, type, category, image, timestamp) VALUES (\"$id\", \"$title\", 'Books', \"$categoryname\", \"$newname2\", NOW())";

                        
$insertsigns = "INSERT INTO temp (userid, title, type, category, image, timestamp)
VALUES
('" . $id . "', '" . $title . "', 'Books', '" . $categoryname . "', '" . $newname2 . "', NOW() )";

 

If userid stores numeric data, remove the ' ' around the " . $id . "

 

Also, should the timestamp field use the time() function?

Uhmm.. still getting the error. The error is referring to the 1st line prior to VALUES.

$insertsigns = "INSERT INTO temp (userid, title, type, category, image, timestamp)
VALUES ('" . $id . "', '" . $title . "', 'Books', '" . $categoryname . "', '" . $newname2 . "', NOW() )";

Please post the full error, with a few lines before/after the specified line in the error.

 

Thanks for pointing that out. Saw a ; missing from the line above calling a function I created. Just don't know why the error was pointing to the line below it.

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.