Jump to content

Parse error: parse error, unexpected T_STRING in


griemar

Recommended Posts

Ok, first off i'm a uber newb to php and mysql, however I'm learning more every day.  I'm just totally stumped on this problem.  I keep getting a Parse error:

Parse error: parse error, unexpected T_STRING in *****\htdocs\racewars\register.php on line 41

As far as I can see there doesn't seem to be any errors.  This is what lines 40 thru 43 looks like:

// now we insert it into the database $insert = "INSERT INTO users (username, password)
VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
$add_member = mysql_query($insert);
?>

I'm trying to create a login/register/logout script for my web page, but can't seem to any of the signup sections to work.  Any help would be awsome!  Also feel free to supply some code that I can experiment with if you have a better idea other than what i posted.

Thanks, Griemar.
Link to comment
Share on other sites

You start your code while still in the comment, so it sees it starting at VALUES
[code]
// now we insert it into the database
$insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
$add_member = mysql_query($insert);
[/code]
Link to comment
Share on other sites

Awsome!  I never seen that, i feel like an idiot, LOL.  Now, I have one more problem that I just noticed.  here is the error:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'http' (10060) in C:\Program Files\xampp\htdocs\racewars\register.php on line 3
Can't connect to MySQL server on 'http' (10060)

Current code minus vital info:

mysql_connect("*******", "******", "******") or die(mysql_error());
mysql_select_db("users") or die(mysql_error());

I know that user name and password are correct because i can access phpAdmin using them, what url do i put in to test locally???
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.