Raised This Month: $ Target: $400
 0% 

SQL_PrepareQuery and "LIKE '%%s%'"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Nepopus
Member
Join Date: Jun 2008
Location: Russia/Moscow
Old 07-19-2008 , 21:41   SQL_PrepareQuery and "LIKE '%%s%'"
Reply With Quote #1

Hello, I have faced such problem:
I wish to get from a database a name of the player, not equal value, but like as.
Directly from a database it looks so: (My nick name is nepopus)
SELECT pp.name FROM ps_plr_profile as pp WHERE pp.name LIKE '%epopu%' ORDER BY pp.name ASC LIMIT 1
in .sma file I entered:
new uniqueid[32]
new fmt[1024]
format(uniqueid, 31, "epopu")
format (fmt, 1023, " SELECT pp.name FROM ps_plr_profile as pp WHERE pp.name LIKE '%%s%' ORDER BY pp.name ASC LIMIT 1 ", uniqueid)
new Handle:rquery = SQL_PrepareQuery (sqlconnect, fmt)
and in game i got a error with "LIKE='%%s%'", how can i do it with '%', '%', but w/o error
huh... i hope you will understand my eng
P.S. its last step for my first version ingame rank system for psychostats, and ill post it when remove this error
__________________
hi maaaaaan
my server here soon

Last edited by Nepopus; 07-19-2008 at 22:27.
Nepopus is offline
Send a message via ICQ to Nepopus Send a message via Skype™ to Nepopus
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode