PDA

View Full Version : SQL Like


hex4
05-09-2007, 05:14 PM
im having a problem using this statement:

SELECT country_id, ban.ban_id, ban_timeadded, ban_cheaternick, ban_startperiod, ban_endperiod, game_name, league_name, league_url FROM ban INNER JOIN game on game.game_id = ban.game_id INNER JOIN league on ban.league_id = league.league_id WHERE ban.ban_cheaternick LIKE '%test\\%'

DOES NOT RETURN ANY RESULTS

SELECT country_id, ban.ban_id, ban_timeadded, ban_cheaternick, ban_startperiod, ban_endperiod, game_name, league_name, league_url FROM ban INNER JOIN game on game.game_id = ban.game_id INNER JOIN league on ban.league_id = league.league_id WHERE ban.ban_cheaternick = 'test\\\'slashes'

RETURN RESULTS AS I WANT

the slashes are added automatically by the mysql_real_escape_string() function.

any useless posts will be deleted...

metallic
05-09-2007, 05:33 PM
Depends on the installation of the SQL.

Some sql servers for example don't allow % or \ . Check the tech details for SQL lite to see whats allowed.

Also try using %test\\%--

hex4
05-09-2007, 07:11 PM
%test\\%-- didnt work + when i try %test% it works ok...

re: ma nistax nsib l ebda hjiel fuq technical details :x

metallic
05-09-2007, 07:34 PM
Then \\ are not recognised by SQL lite heh ;)

hex4
05-09-2007, 07:47 PM
seems like it :/

http://mail-archives.apache.org/mod_mbox/db-derby-dev/200606.mbox/%3C12700083.1149766110586.JavaMail.jira@brutus%3E

u mux nifhem kazz x irrid namel biex biex nirranga :X

yancho
05-09-2007, 07:55 PM
go to this irc network : irc.freenode.net

and join the particular dbms (i presume sql lite) channel and ask there

whenever i have problems iwth sql thats where i seek help from ;)

hex4
05-09-2007, 08:05 PM
Originally posted by yancho
go to this irc network : irc.freenode.net

and join the particular dbms (i presume sql lite) channel and ask there

whenever i have problems iwth sql thats where i seek help from ;)

kieku tghidli naqa channels ahjar :|

metallic
05-09-2007, 08:21 PM
/list

:p

hex4
05-09-2007, 08:22 PM
err.....

zidt ESCAPE '/' waraja u hadmet

:crazy?: :crazy?: :crazy?: :crazy?:

metallic
05-09-2007, 08:23 PM
Weird-o <3