Aka - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Aka (
/showthread.php?tid=635541)
Aka -
Loinal - 08.06.2017
Ok iam trying to create /aka so
PHP код:
new IP[16];
GetPlayerIp(playerid, IP, sizeof(IP));
format(query,sizeof(query), "SELECT `Username` FROM `players` WHERE `IP` LIKE %s",Ip);
mysql_query(mysql,query);
so how to get names?
Re: Aka -
Loinal - 08.06.2017
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?
Re: Aka -
Kane - 09.06.2017
If you're trying to just get the name, here's an example from my script:
PHP код:
new name[40];
mysql_format(m_Handle, query, sizeof(query), "SELECT Name FROM `players` WHERE id = %i LIMIT 1", HouseData[h][houseOwnerSQL]);
mysql_query(m_Handle, query);
cache_get_field_content(0, "Name", name);
Format
name in a string afterwards.
Re: Aka -
Loinal - 09.06.2017
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_Handle, query, sizeof(query), "SELECT Name FROM `players` WHERE id = %i LIMIT 1", HouseData[h][houseOwnerSQL]);
mysql_query(m_Handle, query);
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
Re: Aka -
TwiiKzz - 09.06.2017
You have to loop through all the rows to get the names where ID is euqal to houseOwnerSQL.
Re: Aka -
Loinal - 09.06.2017
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
Re: Aka -
Loinal - 09.06.2017
bumb