Not working code
4 posters
Page 1 of 1
Not working code
- Code:
public iRegister(id, name, password)
{
new buffer[512] = format(buffer, sizeof(buffer), "INSERT INTO irp_users(ip, name, password) VALUES %s, %s, %s", getPlayerIP(id) ,getPlayerName(id), password)
gTmp = samp_mysql_query(buffer)
samp_mysql_real_escape_string(gTmp, gTmp) // This stops SQL injection.
if(!gTmp)
{
format(gTmp, sizeof(gTmp), "[InevitaRP] Failed to register user '%s.' (Reason: Unable to execute query. [Line 18]", getPlayerName(id))
print(gTmp)
SendClientMessage(id, 0xFF0000, gTmp)
}
}
Any ideas?
Xalphox- Intermediate RP-er
- Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23
Character story
Character information:
Re: Not working code
What you using as server name?
Paddy_Collins- RP God
- Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12
Re: Not working code
Paddy_Collins wrote:What you using as server name?
What has the server name got to do with it?
Xalphox- Intermediate RP-er
- Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23
Character story
Character information:
Re: Not working code
I meant the name u use to login in with
Paddy_Collins- RP God
- Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12
Re: Not working code
Jonathon_Cruscoe, but it's fixed now.
The real_escape() simply converts invalid characters (eg. ', ` and ; which are most commonly used for SQL injection(password: lol'; DROP TABLE irp_users --)) to their ascii/utf8 codes.
The real_escape() simply converts invalid characters (eg. ', ` and ; which are most commonly used for SQL injection(password: lol'; DROP TABLE irp_users --)) to their ascii/utf8 codes.
Xalphox- Intermediate RP-er
- Number of posts : 81
Age : 34
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23
Character story
Character information:
Re: Not working code
duh...
I knew that...
I knew that...
Jimmy_Hernandez- Administrator
- Number of posts : 279
Woonplaats : Oisterwijk - The Netherlands
Registration date : 2008-03-09
Character story
Character information: PD Sheriff (Leader) Jimmy Hernandez
Nglsk- Administrator
- Number of posts : 81
Age : 30
Registration date : 2008-04-19
Character story
Character information:
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|