this may be a very stupid question. However im new with mysql and hadn't that much experience.
I wanted to create a fulltext search that searches throught multiple columns for a string. I found the way with Match and Against in the internet and tried it out.
thats whats i left with:
$value = $_POST['value'];
$rechnung_search = mysql_query("SELECT * FROM testTable WHERE MATCH(`name`,`food`) AGAINST ('$value')");
while($row = mysql_fetch_array($testTable_search)){
echo $row['name'];
echo $row['food'];
}
with this code im getting an error that is called:
Warning: mysql_fetch_array() expects parameter 1 to be resource
as far as i know this error appears if there is a wrong information in the query. Howerver I don't know what the wrong information is. All the columns exist. What did i do wrong?
Thank you for reading! Hopefully you can help me solving this.
Something like this
Please use mysqli_* instead of mysql_. Because mysql_ was removed in PHP7.
Also, you have a mistake in your code. Instead of
it should be