<?php 
 $conn = new mysqli('localhost', 'marsalog_mahran', 'gX-;hjZN-B*u', 'marsalog_shipping_clearance_db');

 if ($conn->connect_error) {
     die('Connection failed: ' . $conn->connect_error);
 }
 $sql = "SELECT hr.*, c.company_name_ar, c.company_name_en, d.dept_name, d.dept_name_en, j.job_name, j.job_name_en
 FROM hr_employ_tbl hr
 JOIN main_company_tbl c ON hr.company_id = c.company_id
 JOIN dept_tb d ON hr.dept_id = d.dept_id
 JOIN job_tb j ON hr.job_id = j.job_id
 WHERE hr.employ_id = '271562'";

$result = $conn->query($sql);
if (!$result) {
  echo "Error: " . $conn->error;
}
if ($result->num_rows > 0) {
$row_hr = $result->fetch_assoc();

$employ_name_ar = $row_hr['employ_name_ar'];
$employ_name_en = $row_hr['employ_name_en'];
$employ_email = $row_hr['employ_email'];

$company_name_ar = $row_hr['company_name_ar'];
$company_name_en = $row_hr['company_name_en'];

$dept_name = $row_hr['dept_name'];
$dept_name_en = $row_hr['dept_name_en'];

$job_name = $row_hr['job_name'];
$job_name_en = $row_hr['job_name_en'];
}else{
  echo "no";
}
echo $employ_name_ar;
?>