Welcome, im are beginner on PHP & english, but i need a some help for fix this bug...
And this are the all script:
Thanks!
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!