Why the output returns -1 ?
#1

pawn Код:
stock mysql_Int(db[],fl[],output,input[])
{
    new query[256],Result[256];
    format(query,sizeof(query),"SELECT %s FROM %s WHERE %s",fl,db,input);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if(samp_mysql_fetch_row(Result)==1)
    {
      samp_mysql_fetch_row(Result);
        output=strval(Result);
        return output;
    }
    return 0;
}
if i do this: mysql_Int("users","id",playerinfo[playerid][uid],string); (string = `name`='%s') and then i print playerinfo[playerid][uid] then i see -1
But if i do this: printf("%d",mysql_Int("users","id",playerinfo[playerid][uid],string)) then i get the Real ID

How to fix it?
Reply


Messages In This Thread
Why the output returns -1 ? - by gijsmin - 09.04.2009, 18:08
Re: Why the output returns -1 ? - by tom_jonez - 09.04.2009, 19:28
Re: Why the output returns -1 ? - by gijsmin - 09.04.2009, 19:38
Re: Why the output returns -1 ? - by tom_jonez - 09.04.2009, 19:59
Re: Why the output returns -1 ? - by gijsmin - 09.04.2009, 20:03
Re: Why the output returns -1 ? - by tom_jonez - 09.04.2009, 20:17
Re: Why the output returns -1 ? - by gijsmin - 09.04.2009, 21:52

Forum Jump:


Users browsing this thread: 1 Guest(s)