09.04.2009, 19:28
pawn Код:
stock mysql_Int(db[],fl[],input[])
{
new query[256],Result[256],value[11]; //value is an integer so it doesnt have to be a large string.
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_strtok(value,"|",Result);
new output=strval(value);
return output;
}
return 0;
}
pawn Код:
playerinfo[playerid][uid] = mysql_Int("users","id",string);