Originally Posted by ǝɹoɯ‾ʎ
Quote:
Originally Posted by Izanagi
ran into another problem with my script. here it is
first, the register doesn't "INSERT INTO `accounts` (`accountName`,`Password`,`EMail`) VALUES ('%s','%s','%s')", aName2, aPass2, aEMail2
note, those are escaped strings.
second, whenever my script accesses OnPlayerLogin function it crashes the server. everything is fine if no pasword is given on /login which returns to a client message, but if it's processed into the funciton OnPlayerLogin, it crashes the server. Note that I do not load ALL values yet, this was supposed to be a test
|
OnPlayerLogin
pawn Код:
format(query, sizeof(query), "SELECT * FROM `accounts` WHERE accountName = '%s' AND Password = '%s' LIMIT 1", aName2, aPass2); mysql_query(query); mysql_store_result(); // Check if anything was found if(mysql_num_rows()) { // rest of login code }
OnPlayerRegister
pawn Код:
format(query, sizeof(query), "INSERT INTO `accounts` (accountName,Password,EMail) VALUES ('%s','%s','%s')", aName2, aPass2, aEMail2); mysql_query(query); mysql_store_result(); if(mysql_num_rows()) { SendClientMessage(playerid, COLOR_LIGHTYELLOW, "* [AUTH] Registration Successful! You may now login. "); else SendClientMessage(playerid, COLOR_LIGHTYELLOW, "* [AUTH] Registration Failed... Please report the error if this continues. "); }
` ` - Tables
' ' - String values, (%s)
|