alexkey89
alexkey89

Reputation: 30

Does anyone know what's wrong with mysql query?

   define("QUERY","INSERT INTO rft_media_invention . " " (dbInventionFileType, dbStaffId, dbInventionFileName, dbInventionFileContent)" . "VALUES (?, ?, ?, ?)");

Its always giving me this error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in p3t\phpappfolder\public_php\cw\UC213.php on line 20

anyone knows if my query is fully correct?

Upvotes: 0

Views: 85

Answers (4)

Pramuditha
Pramuditha

Reputation: 1

define("QUERY","INSERT INTO rft_media_invention " . "(dbInventionFileType, dbStaffId, dbInventionFileName, dbInventionFileContent)"

Upvotes: 0

stew
stew

Reputation: 11366

it looks like you need to transpose the first period and the quote that follows it:

...rft_media_invention . " "

should be

...rft_media_invention " . "

Upvotes: 1

kfmfe04
kfmfe04

Reputation: 15327

Try this: Your comma after rtf_media_invention should go after the double quotes, not before.

Upvotes: 0

Marc B
Marc B

Reputation: 360742

Syntax errors:

define("QUERY","INSERT INTO rft_media_invention . " " (dbIn etc...
                                               ^^^^^

should probably be

define("QUERY","INSERT INTO rft_media_invention " . " (dbIn etc...

which also begs the question of why you're concatenating the strings to begin with.

Upvotes: 4

Related Questions