Lamez Posted July 21, 2008 Share Posted July 21, 2008 This is the first time I have ever seen an error like this one. Please tell me how to fix it Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Server\htdocs\_\main\include\process.php on line 96 line 96 is where $query starts. <?php if ($_SESSION['regsuccess'] = true){ $query = "INSERT INTO `accounts` (`login`,`password`, `lastip`, `email`, `flags`) VALUES ('".$_POST['user']."', '".$_POST['pass']."', '".$_SERVER['REMOTE_ADDR']."', '".$_POST['email']"', '".$_POST['type']."')"; mysql_query($query, ACC_NAME); mysql_close(ACC_NAME); } ?> thanks! Quote Link to comment Share on other sites More sharing options...
matmunn14 Posted July 21, 2008 Share Posted July 21, 2008 change: <?php if ($_SESSION['regsuccess'] = true){ $query = "INSERT INTO `accounts` (`login`,`password`, `lastip`, `email`, `flags`) VALUES ('".$_POST['user']."', '".$_POST['pass']."', '".$_SERVER['REMOTE_ADDR']."', '".$_POST['email']"', '".$_POST['type']."')"; mysql_query($query, ACC_NAME); mysql_close(ACC_NAME); } ?> to: <?php if ($_SESSION['regsuccess'] = true){ $query = "INSERT INTO `accounts` (`login`,`password`, `lastip`, `email`, `flags`) VALUES ('".$_POST['user']."', '".$_POST['pass']."', '".$_SERVER['REMOTE_ADDR']."', '".$_POST['email']."', '".$_POST['type']."')"; mysql_query($query, ACC_NAME); mysql_close(ACC_NAME); } ?> Quote Link to comment Share on other sites More sharing options...
Lamez Posted July 21, 2008 Author Share Posted July 21, 2008 gosh I see I for got a "." in my query, I feel retarted. so I fixed that, now I am getting this error here: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Server\htdocs\_\main\include\process.php on line 98 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Server\htdocs\_\main\include\process.php on line 99 98 & 99 <?php mysql_query($query, ACC_NAME); mysql_close(ACC_NAME); ?> they are defined in my constants file. here is my connection file <?php include_once("constants.php"); $connection_w = mysql_connect(WRLD_SERVER, WRLD_USER, WRLD_PASS); mysql_select_db(WRLD_NAME, $connection_w) or die(mysql_error()); $connection_a = mysql_connect(ACC_SERVER, ACC_USER, ACC_PASS); mysql_select_db(ACC_NAME, $connection_a) or die(mysql_error()); ?> Quote Link to comment Share on other sites More sharing options...
blueman378 Posted July 21, 2008 Share Posted July 21, 2008 have you tried echoing them to make sure they acctually contain the values you expect? Quote Link to comment Share on other sites More sharing options...
matmunn14 Posted July 21, 2008 Share Posted July 21, 2008 gosh I see I for got a "." in my query, I feel retarted. Don't worry about it. I do it all the time Quote Link to comment Share on other sites More sharing options...
Lamez Posted July 21, 2008 Author Share Posted July 21, 2008 ya, just did, and I get all my variables. Quote Link to comment Share on other sites More sharing options...
Lamez Posted July 21, 2008 Author Share Posted July 21, 2008 fixed it 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.