I am working on a search engine for a website I'm making for practice.
I'm a newbie to PHP and wonder how I could add multiple SELECT FROM WHEREs
Here's the code:
$query = "SELECT * FROM search WHERE site_keywords LIKE '%$search_value%'";
$run = mysql_query($query);
while ($row=mysql_fetch_array($run)){
$title = $row['site_title'];
$link = $row['site_link'];
$des = $row['site_des'];
echo "<font face=\"Segoe UI Light\"><font size='5'><a href='$link'>$title</a></font></br >";
echo "<font color='green'>$link</font>";
echo "<p>$des</p><hr>";
}
I want it to search in site_keywords, site_title, site_link and site_desc.
Right now it only searches in site_keywords. How could I make it search in all?
I've tried some things now, and I always gets the same error, so here's the error, and the code that the error says is wrong:
Error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:.xampp\htdocs\Practice Websites\PW2\results.php on line 24
I updated the code.
This question is different from others because I've searched for it and I've seen MANY answers. None of them work for me so I asked this question and included my code.
"mysql_fetch_array() expects parameter 1 to be resource (or mysqli_result), boolean given"
That question is not like mine. I want to know how to add multiple SELECT WHERE FROMs not what's wrong with the error I get. I already know that.