Presentation is loading. Please wait.

Presentation is loading. Please wait.

Employee Info Manager. Employee Info Employee_id First_name Last_name Email cell Apartment_id.

Similar presentations


Presentation on theme: "Employee Info Manager. Employee Info Employee_id First_name Last_name Email cell Apartment_id."— Presentation transcript:

1 Employee Info Manager

2 Employee Info Employee_id First_name Last_name Email cell Apartment_id

3 Apartment Apartment_id Address City State

4 Department Department_id department

5 Employee_department Employee_id Department_id

6 position Position_id position

7 employee_position Employee_id Position_id

8 supervisor Supervisor_id Supervisor_first_name Supervisor_last_name Employee_id

9 $query = "SELECT employeeId, email from employee_info"; $result = @mysqli_query($dbc,$query); if($result){ while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){ ## make row into an associatiated array. also there are MYSQLI_NUM(use index to echo) and MYSQLI_BOTH if ($row['employeeId'] == $employeeId or $row['email'] == $email) { $error [] = "Duplicated user or email name"; echo "The employeeId or email is in use. "; }

10 if(!empty($error)){ echo 'Check your input. '; exit(); } $employeeId = mysqli_real_escape_string($dbc, trim($employeeId)); $fname = mysqli_real_escape_string($dbc, trim($fname)); ## trim() get rid of the white spaces $lname = mysqli_real_escape_string($dbc, trim($lname)); $email = mysqli_real_escape_string($dbc, trim($email)); $apartmentID = mysqli_real_escape_string($dbc, trim($apartmentID)); $q = "INSERT INTO employee_info(employee_id, first_name, last_name, email, apartment_id) VALUES ('$employeeId', '$fname','$lname','$email', '$apartmentID')"; $r = @mysqli_query($dbc,$q); if($r){ echo 'You have been successfully registered. '; echo 'Your Employee Id: ', $employeeId, ' '; echo 'Your email: ', $email, ' '; }else{ echo 'System error. '; echo mysqli_error($dbc), ' '; }


Download ppt "Employee Info Manager. Employee Info Employee_id First_name Last_name Email cell Apartment_id."

Similar presentations


Ads by Google