Jump to content


Photo

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


  • Please log in to reply
2 replies to this topic

#1 RSprinkel

RSprinkel
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 16 September 2006 - 04:44 AM

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:
//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);


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

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

RSprinkel
A PHP/MySQL NOVICE I AM

#2 markbett

markbett
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts

Posted 16 September 2006 - 05:21 AM

your missing a " in one of your sql queries... ;-) took me about 15 seconds to find...

#3 RSprinkel

RSprinkel
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 16 September 2006 - 11:08 AM

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



RSprinkel
A PHP/MySQL NOVICE I AM




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users