Jump to content

Parse error: syntax error, unexpected T_STRING in ...


RSprinkel

Recommended Posts

Hi all,

I am trying to create a file to enter some info into a db.  When I try to submit the data I am getting this error"

Parse error: syntax error, unexpected T_STRING in /home/blah/blah/blah/create_profile_process.php on line 69

Here is some of the code above and below line 69:
[code]//insert info into profile table
$comments2 = htmlspecialchars($comments);
$sql = mysql_query ("INSERT INTO profile (username, work, married, children, fdriver, ftrack, fmod, hobbies, hear, say, team, bman, bnmbr, cman, cnmbr, trman, trnmbr, tpman, tpnmbr, lmman, lmnmbr, aman, anmbr, gnman, gnnmbr, owman, ownmbr,)
VALUES('$username','$work','$married','$children','$fdriver','$ftrack','$fmod','$hobbies','$hear','$say','$team','$bman','$bnmbr','$cman','$cnmbr','$trman','$trnmbr','$tpman','$tpnmbr','$lmman','$lmnmbr','$aman','$anmbr','$gnman','$gnnmbr','$owman','$ownmbr') or die (mysql_error());
if(!$sql){
echo 'There has been an error creating your profile. Please contact the webmaster.';
}
$sql = "SELECT * FROM users WHERE username = '$username'";

$result = mysql_query($sql);

$user_array = mysql_fetch_array($result);[/code]


Now Line 69 is:
[code]$sql = "SELECT * FROM users WHERE username = '$username'";[/code]

Now I know it has got to be something I am overlooking and probably a simple fix, but I can't find it.

Thanks much in advance.

RSprinkel
Link to comment
Share on other sites

LOL yup you are right, it is at the end of the latter part right before the "or die".  I also found I Was missing the ) there as well and then I found the ownmbr,) which I had to remove the ",".  Now it works fine.

Thanks for pointing out the missing " that pointed me in the right direction to fix and find the other 2 little issues.

Again Thank you


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.