Question: I'm looking for is to update data from table attendance which is LEFT INNER with table employees. So I used this query 1 UPDATE attendance
I'm looking for is to update data from table attendance which is LEFT INNER with table employees. So I used this query
| 1 | UPDATE attendance att LEFT JOIN employees emp ON(att.employee_id = emp.id) SET date = '2018-04-27', time = '08:00:00', description = 'Sick' WHERE att.id = 1 |
I have two tables one is employees and other is attendance. employees table has fields as (id, employee_id, firstname, lastname, address, email, salary, creacted_on) and attendance table has fields as (id, employee_id, date, time, description). Here is my code. Can someone help me to fix my code.


EDIT Absent
include('security.php' ); $connection - mysqli_connect("localhost", "root", "","project88"); //add attendance if(isset($_POST['add'])){ Samployae_id - $_POST['id']; $date - $_POST['date']; stine = $_POST["time']; Sdate = $_POST["description']; $query = "SELECT *, attendance.id AS caid, employees. employee_id AS enpid FROM attendance LEFT JOIN employees on employees.id=allendarice.employee_id WHERE aLLendance.id = '$employee_id": $query_run - mysqli_query($connection, $query); IF($query_run->nun_rows fetch_assoc(); Senplayer_id - Srow['id']; $query - "INSERT INTO attendance (date, tine, description) VALUES ('Sdate', $tima, Sdascription')"; $query_run - mysqli_query($connection, $query); $_SESSION['status'] = 'advance added successfully"; $_SESSION[ 'status_code'] = "success"; } } elset $_SESSION['error'] - 'Fill up add form first'; header('location: attendance.php'); K?php $connection = mysqli_connect("localhost", "rool", ** "projectes"); $query - "SELECT att.enployea_id, att.data, att.tine, att.description FROM attendance att INNER JOIN Employees and CN emp.id - att.employee_id WHERE att.id - 'sid''; $query_run = mysqli_query($connection, $query);
| Date | Employee ID | Nane | Tinth | Description | Edit | cth>Delete B) { while ($row = mysqli_fetch_assoc($query_r'un)) { strs
|---|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
