Jump to content

Parse error: parse error.


ChrisMartino

Recommended Posts

Hey there,

 

Thanks for taking the time to read, I keep getting a parse error, I'm not sure why though the code seems solid, Here it is:

 

	public function IsValidClient($username)
	{
		$CheckName = mysql_real_escape_string($username);
		$CheckClient = mysql_query("SELECT * FROM Clients WHERE Username = '".$CheckName."'");

		if(mysql_num_rows($CheckClient) == 1)
		{
			return true;
		}
		else
		{
			return echo("Error: The control panel returned a error. (ERROR: #02)");
		}
	}

 

 

The line with the error is were it returns a echo statement. :/

Link to comment
https://forums.phpfreaks.com/topic/199023-parse-error-parse-error/
Share on other sites

 

	public function IsValidClient($username)
	{
		$CheckName = mysql_real_escape_string($username);
		$CheckClient = mysql_query("SELECT * FROM Clients WHERE Username = '".$CheckName."'");

		if(mysql_num_rows($CheckClient) == 1)
		{
			return true;
		}
		else
		{
			return "Error: The control panel returned a error. (ERROR: #02)";
		}
	}
$status = IsValidClient($username);
if($status != TRUE ) {
die($status);
}

 

i guess the problem is here you should replace " with '    like below

 

$CheckClient = mysql_query('SELECT * FROM Clients WHERE Username = "'.$CheckName.' " ');

 

actually if you use STOPFTP it will be easier for you to try these kind of problems. http://www.stopftp.com

 

i guess the problem is here you should replace " with '    like below

 

$CheckClient = mysql_query('SELECT * FROM Clients WHERE Username = "'.$CheckName.' " ');

 

actually if you use STOPFTP it will be easier for you to try these kind of problems. http://www.stopftp.com

 

What he has should work. He never mentioned any other problems tho or if he still is having the problem. He just posted the edited code so we have no idea what's going on.

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.