MySQL loop issue.
#1

Good morning.

I have a function to check whether the id in my database is used or not.

However it is not as super method.

A loop would be better?

Voici le code actuel:

Here is the current code:

pawn Код:
stock IDExistantWeed()
{
    new str[50], weedID = 1;
    format(str, sizeof(str), "SELECT * FROM srp_players_weed WHERE id=%d LIMIT 1", weedID);
    mysql_query(str);
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
       
    }
    else printf("Pas de weed ID SQL: %i", weedID);
    mysql_free_result();
    return 1;
}
And i use:

pawn Код:
idzeub = IDExistantWeed();
WeedInfo[idzeub][ID] = idzeub;
...
Thanks
Reply


Messages In This Thread
MySQL loop issue. - by TheSy - 04.05.2014, 18:41
Re: MySQL loop issue. - by [WSF]ThA_Devil - 04.05.2014, 19:49
Re: MySQL loop issue. - by TheSy - 17.05.2014, 13:15
Re: MySQL loop issue. - by TheSy - 17.05.2014, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)