MYSQL ERROR
Posted: Fri Apr 07, 2017 10:43 am
hi there am new here as well as on database lessons, i was trying to search data in my database in xampp but i get this error "mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\login\search.php on line 15"
my codes are shown below please help me how can i fix that error, thanks in advance
<!DOCTYPE html>
<html>
<head>
<title>search</title>
</head>
<body>
<?php
mysql_connect("localhost", "root", "") or die ("bad connection");
mysql_select_db("test");
$search = mysql_real_escape_string(trim($_POST['searchterm']));
$find_v = mysql_query("select * from 'videos' where 'keyword' like '%$search%' ");
while($row = mysql_fetch_assoc($find_v))
{
$name = $row['name'];
echo "$name<br/>";
};
?>
</body>
</html>
my codes are shown below please help me how can i fix that error, thanks in advance
<!DOCTYPE html>
<html>
<head>
<title>search</title>
</head>
<body>
<?php
mysql_connect("localhost", "root", "") or die ("bad connection");
mysql_select_db("test");
$search = mysql_real_escape_string(trim($_POST['searchterm']));
$find_v = mysql_query("select * from 'videos' where 'keyword' like '%$search%' ");
while($row = mysql_fetch_assoc($find_v))
{
$name = $row['name'];
echo "$name<br/>";
};
?>
</body>
</html>