03.04.2014, 12:23
I have a query like this:
With this query I get all the pgs associated to the user account on the table users. I want to put the name and the surname on a variable (or two variables, I don't know how to do that).
When I have just one field to select I usually do:
If I have multiple fields or multiple rows how I do that?
Thanks for the help.
Код:
SELECT name, surname FROM `pgs`,`users` WHERE `username`='%s'
When I have just one field to select I usually do:
pawn Код:
new query[90];
new result[10];
new ris;
format(query,sizeof(query),"SELECT `admin` FROM `users` WHERE `username` = '%s'", GetName(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
mysql_fetch_row_format(result);
ris = strval(result);
}
mysql_free_result();
Thanks for the help.