SA-MP Forums Archive
Problem with %%%S% - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with %%%S% (/showthread.php?tid=210732)



[Solved]Problem with %%%S% - scott1 - 13.01.2011

Hi !

i am doing an sql system, so in an cmd, i need to cound number of players,

So i did


Код:
mysql_real_escape_string(inputtext, pseudosafe);
			format(query, sizeof(query), "SELECT COUNT(*) FROM `table_account` WHERE Nam LIKE '%%s%'",pseudosafe);
But the %%s% fucked up with the pseudosafe.

What can i do?

Max


Re: Problem with %%%S% - NewbBeginner - 13.01.2011

Код:
mysql_real_escape_string(inputtext, pseudosafe);
			format(query, sizeof(query), "SELECT COUNT(*) FROM `table_account` WHERE Nam LIKE '%s'",pseudosafe);



Re : Problem with %%%S% - scott1 - 13.01.2011

No, i need %before and % after toget all result


Re : Problem with %%%S% - scott1 - 13.01.2011

http://www.1keydata.com/sql/sqllike.html

Quote:

SELECT *
FROM Store_Information
WHERE store_name LIKE '%AN%'




Re: Problem with %%%S% - Biesmen - 13.01.2011

Never heard of that before.


Re: Re : Problem with %%%S% - PeteShag - 13.01.2011

Quote:
Originally Posted by scott1
Посмотреть сообщение
No, i need %before and % after toget all result
No you don't since you've got only one variable.

Код:
pseudosafe



Re: Problem with %%%S% - Sergei - 13.01.2011

Код:
"SELECT COUNT(*) FROM `table_account` WHERE Nam LIKE '%%%s%%'"
SAMP wiki is your friend next time, okay?


Re : Problem with %%%S% - scott1 - 13.01.2011

i need it for my query

like

%Max%

will give me

Maxwell_Nolin
Maxime_Norris
Julian_Maxvin

...


Re : Problem with %%%S% - scott1 - 13.01.2011

I found, simply Do %%%s%%