Not working code

Go down

Not working code

Post  Xalphox on Mon Apr 28, 2008 11:45 pm

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
Intermediate RP-er

Number of posts : 81
Age : 29
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

View user profile http://www.ageofgaming.net

Back to top Go down

Re: Not working code

Post  Paddy_Collins on Tue Apr 29, 2008 12:09 am

What you using as server name?

_________________

Name = Paddy_Collins
Level = 15
Admin Level = 4
The Evil God Admin Of Doom!
The Photographer!
avatar
Paddy_Collins
RP God
RP God

Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12

View user profile

Back to top Go down

Re: Not working code

Post  Xalphox on Tue Apr 29, 2008 12:13 am

Paddy_Collins wrote:What you using as server name?

What has the server name got to do with it?

Xalphox
Intermediate RP-er
Intermediate RP-er

Number of posts : 81
Age : 29
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

View user profile http://www.ageofgaming.net

Back to top Go down

Re: Not working code

Post  Paddy_Collins on Tue Apr 29, 2008 1:03 am

I meant the name u use to login in with Very Happy

_________________

Name = Paddy_Collins
Level = 15
Admin Level = 4
The Evil God Admin Of Doom!
The Photographer!
avatar
Paddy_Collins
RP God
RP God

Number of posts : 176
Woonplaats : Prossy-Land And JimmySucks-Land
Registration date : 2008-03-12

View user profile

Back to top Go down

Re: Not working code

Post  Xalphox on Tue Apr 29, 2008 7:35 pm

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.

Xalphox
Intermediate RP-er
Intermediate RP-er

Number of posts : 81
Age : 29
Woonplaats : is this a new type of disease?
Registration date : 2008-04-23

Character story
Character information:

View user profile http://www.ageofgaming.net

Back to top Go down

Re: Not working code

Post  Jimmy_Hernandez on Tue Apr 29, 2008 7:36 pm

duh...

I knew that...

_________________
Jimmy Hernandez
Wild West RP Server + Forum Administrator
Fort Carson Police Department Sheriff [Leader]
Abondoned Airport Leader + Leader of the AA Stunt-Team.
Member of the [ET] Event Team.


avatar
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

View user profile http://nextgeneration2008.forumotion.com

Back to top Go down

Re: Not working code

Post  Nglsk on Wed Apr 30, 2008 12:10 am

LOL
avatar
Nglsk
Administrator

Number of posts : 81
Age : 25
Registration date : 2008-04-19

Character story
Character information:

View user profile

Back to top Go down

Re: Not working code

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum