I get this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
when I changed my code to this
$term = $_POST["term"];
$query = mysql_query("SELECT id FROM planet1 WHERE MATCH (title) AGAINST ('$term')");
while($row = mysql_fetch_array( $query )) {
echo $row['id'],'<br>';
}
This happens when there is an error during the execution of the SQL query :
mysql_query()returnsfalsemysql_fetch_array()expects.You should try calling
mysql_error(), to have some information about the error that’s caused by the execution of your MySQL :Note: of course, this echo+die is OK while developping, but should never be present on a production server.