woodplease Posted February 20, 2012 Share Posted February 20, 2012 hey, i'm having an sql syntax error message display when trying to search my database. "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MATCH ('entry_text') AGAINST ('ancient')' at line 1" 'ancient' is the value being held in $search_string the code that i'm using is <?php if (isset($_POST['search_string'])){ $search_string = mysql_real_escape_string($_POST['search_string']); } ?> <form name="wikisearch" method="post" action="test.php"> <input type="text" name="search_string" size="40" /> <input type="submit" name="search" value="Search" /> </form> <?php if (isset($_POST['search_string'])){ $res = mysql_query("SELECT * FROM entry MATCH ('entry_text') AGAINST ('$search_string')")or die (mysql_error()); $ant = mysql_num_rows($res); echo "results: ".$ant; } ?> ANy ideas whats wrong Link to comment https://forums.phpfreaks.com/topic/257373-full-text-search/ Share on other sites More sharing options...
fenway Posted February 20, 2012 Share Posted February 20, 2012 Solved how? Link to comment https://forums.phpfreaks.com/topic/257373-full-text-search/#findComment-1319194 Share on other sites More sharing options...
sunfighter Posted February 20, 2012 Share Posted February 20, 2012 @fenway I've never seen MATCH --- AGAINST Shouldn't it be $res = mysql_query("SELECT * FROM entry WHERE `entry_text` = '$search_string'")or die (mysql_error());? Link to comment https://forums.phpfreaks.com/topic/257373-full-text-search/#findComment-1319196 Share on other sites More sharing options...
fenway Posted February 20, 2012 Share Posted February 20, 2012 MATCH...AGAINST exists -- check the refman. Link to comment https://forums.phpfreaks.com/topic/257373-full-text-search/#findComment-1319203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.