Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in sql statement

Status
Not open for further replies.

sbayter

IS-IT--Management
Nov 14, 2002
95
CO
Hi,
I have this sql statement that will be inserted into a mySQL db. However it is giving me the following error:

Parse error: parse error, unexpected T_STRING in c:\web\process\test.php on line 72



$sql = "INSERT INTO request SET "
EMAIL = '$email', ---->line 72
PHONE = '$phone',
DEPARTMENT = '$department',
TYPE_OF_REQUEST = '$typeofrequest',
NUMBER_OF_REQUESTS = '$numberofrequests',
PRIORITY = '$priority',
LOCATION = '$location',
CONTENT = '$content',
FILENAME1 = '$upload1'"";

Any mistakes you can see?
Thanks,

sbayter
 
sbayter:

1. Please post your code in the TGML code tags in the future.

2. If what I see posted is correct then you should remove the double quote from the end of the line preceding line 72.
 
I see two to many doublequotes in that line.

The first one is here:
Code:
sql = "INSERT INTO request SET "
Which is where your error appears. You can have a string literal run across more than one line, but only if you leave the literal open. Since you close the literal with the second doublequote, PHP assumes that's the end of the assignement statement. And so it's complaining about the lack of a semicolon at the end of that line.

The second is here:
Code:
FILENAME1 = '$upload1'"";
I'm not sure what you're intending to do with that double doublequote, but PHP is going to have a problem with it.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top