30.01.2012, 01:39
Hello Community.
I tryed to Create my Own MySQL Login/Registersystem but when i try to register it gives me an syntax error:
My Register Code are as following:
Database:
Iam using Strickenkid's MySQL Plugin and i dont get any errors.
can anyone tell me whats wrong on the syntax ?
Regards Tigerkiller
I tryed to Create my Own MySQL Login/Registersystem but when i try to register it gives me an syntax error:
Код:
[Mon Jan 30 03:36:25 2012] Error (0): Failed to exeute query. 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 'Alter, Geschlecht, Muted, Freezed, Tutorial) VALUES ('[GRW]Firebird','TestPasswort',' at line 1.
pawn Код:
public OnPlayerRegister(playerid,key[])
{
printf("playerid: %i - Passwort: %s",playerid,key);
new Name[MAX_PLAYER_NAME], Query[500], escname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof Name);
mysql_real_escape_string(Name,escname);
format(Query,sizeof Query,"INSERT INTO `Accounts` (Nickname, Passwort, Admin, Level, Respect, Geld, Handy, HandyGeld, Fraktion, Leader, Alter, Geschlecht, Muted, Freezed, Tutorial) VALUES ('%s','%s',0,1,0,20000,1,50,0,0,0,0,0,0,0)",escname,key);
printf("%s",Query);
mysql_query(Query);
}
Код:
CREATE TABLE `GRW`.`Accounts` ( `ID` INT( 255 ) NOT NULL AUTO_INCREMENT , `Nickname` VARCHAR( 30 ) NOT NULL , `Passwort` VARCHAR( 20 ) NOT NULL , `Admin` INT( 2 ) NOT NULL , `Level` INT( 100 ) NOT NULL , `Respect` INT( 100 ) NOT NULL , `Geld` INT( 50 ) NOT NULL , `Handy` INT( 2 ) NOT NULL , `HandyGeld` INT( 100 ) NOT NULL , `Fraktion` INT( 3 ) NOT NULL , `Leader` INT( 3 ) NOT NULL , `Alter` INT( 2 ) NOT NULL , `Geschlecht` INT( 1 ) NOT NULL , `Muted` INT( 1 ) NOT NULL , `Freezed` INT( 1 ) NOT NULL , `Tutorial` INT( 1 ) NOT NULL , PRIMARY KEY ( `ID` ) ) ENGINE = MYISAM ;
can anyone tell me whats wrong on the syntax ?
Regards Tigerkiller