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! Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/ 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); } ?> Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595305 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()); ?> Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595306 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? Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595307 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 Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595309 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. Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595310 Share on other sites More sharing options...
Lamez Posted July 21, 2008 Author Share Posted July 21, 2008 fixed it Link to comment https://forums.phpfreaks.com/topic/115802-solved-i-do-not-understand-this-error/#findComment-595319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.