I have a database of employees, with a search form, search the user says the name, surname, photo and the position. I have below the names of the employees and I want them to click on a page with their details (Name, Surname, position and photo) when they click on it.
this is my query to see the details
emp_detalles.php
<div id="content">
details view.
<?php
$user = "root";
$password = "";
$host = "localhost";
$dbase = "employees_assign";
$table = "tbl_employees";
$connect = new mysqli($host, $user, $password, $dbase);
$sql = ("SELECT * from tbl_employees");
$emp= $connect->query($sql);
echo '<li id="names"><a href="index.php?id='.$emp['emp_id'].'">'.$emp['emp_fname'].' '.$emp['emp_lname'].' '.$emp['emp_lname'].' </a></li>';
?>
</div>
But he tells me that
details view.
Fatal error: Uncaught Error: Cannot use object of type mysqli_result as array in C:\wamp64\www\employees_done\views\emp_detail.php:18 Stack trace: #0 {main} thrown in C:\wamp64\www\employees_done\views\emp_detail.php on line 18
I have tried in all ways, and I have not been able to give me the details.
I appreciate the attention