SQL issues.
#5

It has done so up until I created this command:

pawn Code:
command(contract, playerid, params[])
{
    new name[24], price, string[128], query[128];
    if(sscanf(params, "s[24]i", name, price))return SendClientMessage(playerid, GREY, "Usage: /contract [Full_Name] [price]");
    {
        if(price < 50000)return SendClientMessage(playerid, GREY, "The minimum price for a contract is $50,000.");
        if(price > 1000000)return SendClientMessage(playerid, GREY, "The maximum price for a contract is $1,000,000.");
        if(price > Player[playerid][Money]) return SendClientMessage(playerid, GREY, "You don't have enough money to place this contract.");
       
        format(query, sizeof(query), "SELECT `user` FROM accounts WHERE `user`='%s'", name);
        mysql_query(query);
        print(query);
           
        if(!mysql_num_rows())
        {
            SendClientMessage(playerid, GREY, "That name isn't in the database.");
        }
        else
        {
            Player[playerid][Money] -= price;
            format(string, sizeof(string), "[Contract] A contract for $%s has been added to your PDA. Please check it now.", FormatNumber(price));
            SendFactionMessage(2, YELLOW, string);
            SaveContract(pName(playerid), name, price);
            format(string, sizeof(string), "You have successfully placed a hit on %s for $%s.", name, FormatNumber(price));
            SendClientMessage(playerid, YELLOW, string);
        }
    }
    return 1;
}
When I remove:
pawn Code:
format(query, sizeof(query), "SELECT `user` FROM accounts WHERE `user`='%s'", name);
        mysql_query(query);
        print(query);
           
        if(!mysql_num_rows())
        {
            SendClientMessage(playerid, GREY, "That name isn't in the database.");
        }
        else
It has no problem, just can't check the name.
Reply


Messages In This Thread
SQL issues. - by JoelR - 30.12.2012, 06:45
Re: SQL issues. - by Abreezy - 30.12.2012, 06:56
Re: SQL issues. - by JoelR - 30.12.2012, 07:03
Re: SQL issues. - by Abreezy - 30.12.2012, 07:07
Re: SQL issues. - by JoelR - 30.12.2012, 07:08
Re: SQL issues. - by Peach - 30.12.2012, 10:39

Forum Jump:


Users browsing this thread: 3 Guest(s)