- Edited
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\laragon\www\newsystem\searchProceeding.php on line 51
Hi, I am trying to do a search web page for the Proceeding title but I have this one problem. I don't know what is the problem, I have looked thoroughly but still don't find it. Please help me. FYI, I don't have any problem with the SQL query on the database.
<?php
include "dbconnect.php";
$keyword=$_GET['keyword'];
$sql="SELECT proceedings.id, proceedings.title, proceedings.author, institutions.name
FROM proceedings
INNER JOIN institutions
ON proceedings.institution_code=institutions.institution_code;
WHERE 'title' LIKE '%$keyword%'";
$result = mysqli_query($conn, $sql);
?>
<table class="table">
<tr>
<td>ID</td>
<td>Title</td>
<td>Author</td>
<td>Institution name</td>
</tr>
<?php
if(mysqli_num_rows($result)>0){
while ($row=mysqli_fetch_assoc(
$result)){
echo "<tr>";
echo " <td> ".$row['id']."</td>";
echo "<td> ".$row['title']."</td>";
echo "<td> ".$row['author']."</td>";
echo " <td> ".$row['name']."</td>";
echo "</tr>";
}
}
?>
</table>