Searching phpbb's 'topic_title' via MYSQL php, but exact match doesn't work

Posted by Mint on Stack Overflow See other posts from Stack Overflow or by Mint
Published on 2010-04-06T04:55:50Z Indexed on 2010/04/06 5:03 UTC
Read the original article Hit count: 479

Filed under:
|
|
|
$sql = sprintf("SELECT topic_title FROM `phpbb_topics` WHERE `topic_title` LIKE '%%%s%%' LIMIT 20", mysql_real_escape_string('match this title'));

Which I run this query in phpMyAdmin the results are: (correct)

match this title
match this title 002

But when I run that same MYSQL query in PHP I get: (incorrect)

match this title 002

I have also tried MATCH AGAINST with the same result with both php and phpMyAdmin:

$sql = "SELECT topic_title FROM phpbb_topics WHERE MATCH (topic_title) AGAINST('match this title' IN BOOLEAN MODE)";

Whats going on?

I'v been searching all over the place and have found next to no help :(

© Stack Overflow or respective owner

Related posts about phpbb

Related posts about mysql