kalster Posted October 14, 2014 Share Posted October 14, 2014 why is this code not working? in php i have the following... $keywords = "+hello +world"; $query= "SELECT * FROM forums WHERE MATCH (topics) AGAINST ('$keywords' IN BOOLEAN MODE)"; $results = mysqli_query($database, $query); $row = mysqli_fetch_assoc($results); $topics = $row['topics']; echo $topics; Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given... Quote Link to comment Share on other sites More sharing options...
requinix Posted October 14, 2014 Share Posted October 14, 2014 Have you tried using mysqli_error to get an error message? Quote Link to comment Share on other sites More sharing options...
kalster Posted October 14, 2014 Author Share Posted October 14, 2014 I just tried mysql_error for the first time. Errormessage: The used table type doesn't support FULLTEXT indexes. ENGINE=MyISAM solved the problem. thank you. Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted October 15, 2014 Share Posted October 15, 2014 (edited) mysql version 5.6+ supports fulltext boolean for innodb Edited October 15, 2014 by QuickOldCar Quote Link to comment Share on other sites More sharing options...
kalster Posted October 15, 2014 Author Share Posted October 15, 2014 (edited) How can I get the following to work? The code does not work when $author is emtpy. I need the code to work when the $author string is empty or not. Thank you in advanced. $query= "SELECT * FROM forums WHERE MATCH (topics) AGAINST ('$keywords' IN BOOLEAN MODE) AND MATCH (users) AGAINST ('$author' IN BOOLEAN MODE)"; Edited October 15, 2014 by kalster Quote Link to comment Share on other sites More sharing options...
Solution kalster Posted October 15, 2014 Author Solution Share Posted October 15, 2014 (edited) The post above was fixed by a php if statement to determine if the $author variable was empty Edited October 15, 2014 by kalster Quote Link to comment 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.