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... Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/ 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? Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/#findComment-1493549 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. Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/#findComment-1493550 Share on other sites More sharing options...
QuickOldCar Posted October 15, 2014 Share Posted October 15, 2014 mysql version 5.6+ supports fulltext boolean for innodb Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/#findComment-1493557 Share on other sites More sharing options...
kalster Posted October 15, 2014 Author Share Posted October 15, 2014 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)"; Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/#findComment-1493562 Share on other sites More sharing options...
kalster Posted October 15, 2014 Author Share Posted October 15, 2014 The post above was fixed by a php if statement to determine if the $author variable was empty Link to comment https://forums.phpfreaks.com/topic/291624-mysql-in-boolean-mode-error/#findComment-1493563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.