xam Posted June 6, 2006 Share Posted June 6, 2006 Hello everyone,I dont know whats wrong with below sql code.. [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--]$keywords [color=orange]=[/color] trim($_GET[[color=red]"keywords"[/color]]);$ekeywords [color=orange]=[/color] sqlesc($keywords);$res [color=orange]=[/color] mysql_query([color=red]"[span style=\'color:blue;font-weight:bold\']SELECT[/color] [color=blue]COUNT[/color](*) [color=green]FROM[/color] [color=orange]posts[/color] [color=green]WHERE[/color] MATCH (body) AGAINST ($ekeywords)"[/span]) [color=blue]or[/color] sqlerr(__FILE__, __LINE__);$arr [color=orange]=[/color] mysql_fetch_row($res); $hits [color=orange]=[/color] 0 [color=orange]+[/color] $arr[0]; if ($hits [color=orange]=[/color][color=orange]=[/color] 0) print([color=red]"[span style=\'color:orange\']<[/color]p[color=orange]>[/color][color=orange]<[/color]b[color=orange]>[/color]Sorry, nothing found![color=orange]<[/color]/b[color=orange]>[/color][color=orange]<[/color]/p[color=orange]>[/color]"[/span]); else {showing search results....[!--sql2--][/div][!--sql3--]the sql code return with 0 results, it wont work.. Please help.. Quote Link to comment https://forums.phpfreaks.com/topic/11369-whats-wrong/ Share on other sites More sharing options...
xam Posted June 6, 2006 Author Share Posted June 6, 2006 I've changed sql table from latin to utf8 and now the code works but its case sensItIve now.. how do I ignore it? Quote Link to comment https://forums.phpfreaks.com/topic/11369-whats-wrong/#findComment-42625 Share on other sites More sharing options...
fenway Posted June 7, 2006 Share Posted June 7, 2006 [!--quoteo(post=380816:date=Jun 6 2006, 06:38 PM:name=xam)--][div class=\'quotetop\']QUOTE(xam @ Jun 6 2006, 06:38 PM) [snapback]380816[/snapback][/div][div class=\'quotemain\'][!--quotec--]I've changed sql table from latin to utf8 and now the code works but its case sensItIve now.. how do I ignore it?[/quote]Not sure how this fixed the problem, but you'll need to find a case-insensitive collation for your table, or else collate each argument "back". Quote Link to comment https://forums.phpfreaks.com/topic/11369-whats-wrong/#findComment-42938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.