griemar Posted January 24, 2007 Share Posted January 24, 2007 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 41As 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. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 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] Quote Link to comment Share on other sites More sharing options...
griemar Posted January 24, 2007 Author Share Posted January 24, 2007 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 3Can'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??? Quote Link to comment Share on other sites More sharing options...
linuxdream Posted January 24, 2007 Share Posted January 24, 2007 host would be "localhost" Quote Link to comment Share on other sites More sharing options...
griemar Posted January 24, 2007 Author Share Posted January 24, 2007 Man, you have made my day ;D. I have been trying for 3 days to get that simple script to work and couldn't figure it out. I can finally finish the designing end of things. Thank you SOOO much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.