So, I followed a tutorial on youtube = Creating a PHP Search by TheHelpingDevelop
This is the 10th Tutorial I have now followed, I can not understand whats going wrong, Please help
My table name is = avatar_list
the two fields im trying to bring out are
name
solution (I am not trying to search this field)
I am only trying the search the name column
[php]
<? include_once ("header.inc.php"); $output = ''; if(isset($_POST['search'])) { $searchq = $_POST['search']; $query = mysql_query("SELECT * FROM avatar_list WHERE name LIKE '%searchq%'") or die("could not search"); $count = mysql_num_rows($query); if($count == 0) { $output ='No search results'; }else{ while($row = mysql_fetch_array($query)) { $name = $row['name']; $solution = $row['solution']; $output .= ''.$name.' '.$solution.''; } } } ?>Search
Seach for: <?php print("$output");?>[/php]
This script is bringing nothing back for me, i get
No search results
So, Can someone help me, where am I going wrong
(My db connection is in my header.inc.php)