Jump to content

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


?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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