MySQL Reg help.
#1

I'm not sure what I am having a problem with right now, seems as everything is fine;

pawn Код:
if(dialogid == DReg)
    {
        if(response == 1)
        {
            new
                str[128],
                password[50];
            format(str, 128, "SELECT * FROM `playerinfo` WHERE `user` = '%s'", pName(playerid));
            mysql_query(str);
            mysql_store_result();
            if(mysql_num_rows() == 1)
            {
                SendClientMessage(playerid, RED, "ERROR: This account is already registered!");
                ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "RC:RP Login", "Please enter your password below to login", "Login", "Cancel");
                mysql_free_result();
                return 1;
            }
            mysql_free_result();
            CMySQL_Create(str, ACCOUNT_TABLE, "User");
            CMySQL_Password(str, ACCOUNT_TABLE, "Password", inputtext);
            CMySQL_SetInt(str, ACCOUNT_TABLE, "User", "Money", 5000);
        }
        else
        {
            SendClientMessage(playerid, GREEN, "You have cancelled registration, you have been kicked");
            Kick(playerid);
        }
    }
This is my dialog code; used for DIALOG_STYLE_INPUT.

I have tried registering, but it comes out pretty odd.
Console Output (Stricken Kid's):
Quote:

[12:59:22] [join] Toni_Tang has joined the server (0:192.168.1.75)
[12:59:27] MySQL Error (0): Could not execute 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 'SELECT * FROM `playerinfo` WHERE `user` = \'Toni_Tang\' = ''' at line 1.

And this is the output after registering in phpMyAdmin:
Quote:

SELECT * FROM `playerinf

Apparently that was my value 'username'.

Can someone please help.
Reply


Messages In This Thread
MySQL Reg help. - by Toni - 06.08.2010, 17:58
Re: MySQL Reg help. - by Toni - 06.08.2010, 20:01
Re: MySQL Reg help. - by Kar - 06.08.2010, 20:19
Re: MySQL Reg help. - by MadeMan - 06.08.2010, 20:27
Re: MySQL Reg help. - by Toni - 06.08.2010, 20:30
Re: MySQL Reg help. - by Kar - 06.08.2010, 20:31
Re: MySQL Reg help. - by Carlton - 06.08.2010, 20:35
Re: MySQL Reg help. - by Toni - 06.08.2010, 20:44
Re: MySQL Reg help. - by Kar - 06.08.2010, 20:46
Re: MySQL Reg help. - by Toni - 06.08.2010, 20:50

Forum Jump:


Users browsing this thread: 3 Guest(s)