#1

Ok iam trying to create /aka so

PHP код:
new IP[16];
GetPlayerIp(playeridIPsizeof(IP));
format(query,sizeof(query), "SELECT `Username` FROM `players` WHERE `IP` LIKE %s",Ip);
mysql_query(mysql,query); 
so how to get names?
Reply
#2

Also should i use threated query or normal query

Like
i can replace

mysql_query(mysql,query);
to
mysql_tquery(mysql,query);

Would be better??

also if i used tquery

PHP код:
mysql_query(mysql"SELECT Username FROM players WHERE Admin = 3"); 
i can use tquery in this?
Reply
#3

If you're trying to just get the name, here's an example from my script:
PHP код:
new name[40];

mysql_format(m_Handlequerysizeof(query), "SELECT Name FROM `players` WHERE id = %i LIMIT 1"HouseData[h][houseOwnerSQL]); 
mysql_query(m_Handlequery);
cache_get_field_content(0"Name"name); 
Format name in a string afterwards.
Reply
#4

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
If you're trying to just get the name, here's an example from my script:
PHP код:
new name[40];
mysql_format(m_Handlequerysizeof(query), "SELECT Name FROM `players` WHERE id = %i LIMIT 1"HouseData[h][houseOwnerSQL]); 
mysql_query(m_Handlequery);
cache_get_field_content(0"Name"name); 
Format name in a string afterwards.
Its "Name" or %s?
Also i asked a question for the tquery and query
Also why not using Like %d?? I want all names
Reply
#5

You have to loop through all the rows to get the names where ID is euqal to houseOwnerSQL.
Reply
#6

Quote:
Originally Posted by TwiiKzz
Посмотреть сообщение
You have to loop through all the rows to get the names where ID is euqal to houseOwnerSQL.
No man look at my code at the topic i need just to get all names not 1 name
Reply
#7

bumb
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)