I'm trying to make a search engine by watching a tutorial, exactly copied every code but in the middle of the tutorial I'm stuck, The guy Alex from PHPacademy smoothly goes off, but I cant proceed for this error. Please HELP!
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in Y:\wamp\www\SearchEngine\search.php on line 27
Code PHP:<?php //get data $button = $_GET['submit']; $search = $_GET['search']; if (!$button) echo "You didn't submit a keyword"; else { if (strlen($search)<=2) echo "search term is too short"; else { echo "You searched for $search<hr size='1'>"; //Connect to our Database mysql_connect("localhost","root",""); mysql_select_db("searchengine") or die(mysql_error()); $get = mysql_query("SELECT * FROM 'search'"); while ($result = mysql_fetch_assoc($get)) <<<<----------------------LINE 27-------------------------- { $search_exploded = explode(" ",$search); foreach(search_exploded as $search_each) { echo $search_each."<br>"; } } } } ?>





Bookmarks