Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed image text in transcribed

EDIT Absent
Epphp $connection = mysqli_connect("localhost", "root", "", "projecte!"); If (isset($_POST['edit_btn'])) { $id - $_POST['edit_id"]; Squery = "SELECT att.employee_id, att.date, att.time, att.description FROM attendance att LEFT JOIN employees emp ON emp.id - att.employee_id WHERE att.id ='$id'"; $result - mysqli_query($connection, $query); while ($row = mysqli_fetch_assoc($result)) 8
CANCEL
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); cth>Delete B) { while ($row = mysqli_fetch_assoc($query_r'un)) { strs
Date Employee ID Nane Tinth Description Edit
">

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

Students also viewed these Databases questions