Jump to content

[SOLVED] I do not understand this error.


Lamez

Recommended Posts

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

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);
	 }
?>

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());


?>

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.