24.09.2011, 14:23
hello, i have a_sampmysql.inc with this natives
how I can select all users from the table and show them in the sendcliendmessage?
my code
please help me with this function, thx
PHP код:
native samp_mysql_connect(server[], user[], password[]);
native samp_mysql_select_db(db[]);
native samp_mysql_query(query[]);
native samp_mysql_store_result();
native samp_mysql_fetch_row(line[]);
native samp_mysql_get_field(field[], value[]);
native samp_mysql_num_rows();
native samp_mysql_num_fields();
native samp_mysql_ping();
native samp_mysql_real_escape_string(src[], dest[]);
native samp_mysql_free_result();
native samp_mysql_strtok(dest[], separator[], src[]);
native samp_mysql_close();
my code
PHP код:
new query[64];
format(query, sizeof(query), "SELECT * FROM players WHERE member = 1");
samp_mysql_query(query);
samp_mysql_store_result();
for(new i; i < findmember?; i++)
{
format(string, sizeof(string), "Name %s",namefromdb?);
SendClientMessage(playerid, COLOR_YELLOW, string);
}