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.
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]
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???

Archived

This topic is now archived and is closed to further replies.

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