View Single Post
Old 25/02/2011, 08:14 PM   #1
ajwar
Huge Clucker
 
Join Date: May 2009
Location: Norway
Posts: 321
Reputation: 2
Default Help converting to mysql

Can someone help me to convert this script to mysql? (r5 plugin)

pawn Code:
for(new i=0; i<MAX_PLAYERS; i++)
    if (PVar[i][pNumber] == PVar[playerid][pNumber] && i != playerid) return 1;
   
        if (fexist("numbers_used.txt"))
        {
            new File:ftw = fopen("numbers_used.txt", io_read);
            new tmp[7];
            while(fread(ftw, tmp))
            {
                printf("[%d]", strval(tmp));
                if (strval(tmp) == PVar[playerid][pNumber]) return 1;
            }
            fclose(ftw);
        }
        return 0;

Tried so but it has some errors:

pawn Code:
for(new i=0; i<MAX_PLAYERS; i++)
        if (PVar[i][pNumber] == PVar[playerid][pNumber] && i != playerid) return 1;

        mysql_query("SELECT Number FROM `playerinfo` WHERE Number='%s'",PVar[playerid][pNumber]");
        mysql_store_result();
        if(mysql_num_rows() > 0)
        {
       
        }
        else
        {
            return 1;
        }
        mysql_free_result()

Can any onehelp?

Last edited by ajwar; 25/02/2011 at 09:01 PM.
ajwar is offline