Problem with %%%S%
#1

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
Reply
#2

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

No, i need %before and % after toget all result
Reply
#4

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

Quote:

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

Reply
#5

Never heard of that before.
Reply
#6

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
Reply
#7

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

i need it for my query

like

%Max%

will give me

Maxwell_Nolin
Maxime_Norris
Julian_Maxvin

...
Reply
#9

I found, simply Do %%%s%%
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)