• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

(PHP) On Create Account

Kask

Banned User
Joined
Jan 3, 2008
Messages
376
Reaction score
1
Welcome, im are beginner on PHP & english, but i need a some help for fix this bug...

Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\engine.php on line 46

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\engine.php on line 46
Couldn't create account: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key, email, blocked, warning, group_id) VALUES ('59498901', 'lol123', 1, 0, 0,''' at line 1

And this are the all script:
Code:
class Engine extends Database
{
	function GetAccount($num)
	{
		$sql = "SELECT * FROM accounts WHERE account_id='".$num."'";
		return $this->consult($sql);
	}

	function GetPlayer($name)
	{
		$sql = "SELECT * FROM players WHERE name='".$name."'";
		return $this->consult($sql);
	}

	function GetPlayerById($id)
	{
		$sql = "SELECT * FROM players WHERE id='".$id."'";
		return $this->consult($sql);
	}

	function GetPlayers($account_id)
	{
		$sql = "SELECT * FROM players WHERE account='".$account_id."'";
		return $this->consult($sql, 1);
	}

	function CreateAccount($num, $pwd)
	{
		if($this->GetAccount($num))
			return false;
		
		$sql = "INSERT INTO accounts (id, password, type, premDays, lastday, key, email, 

blocked, warnings, group_id) 
VALUES ('', '".$num."', '".$pwd."', 0, 0, '0', '', 0, 0, 1)";

		return $this->query($sql);
	}

Thanks!
 
i think in this fuction:

Code:
	function GetAccount($num)
	{
		$sql = "SELECT * FROM accounts WHERE account_id='".$num."'";
		return $this->consult($sql);
	}

	function GetPlayer($name)
	{
		$sql = "SELECT * FROM players WHERE name='".$name."'";
		return $this->consult($sql);
	}


	function GetPlayers($account_id)
	{
		$sql = "SELECT * FROM players WHERE account='".$account_id."'";
		return $this->consult($sql, 1);

Re-add all and i think can be running.
 
Back
Top