<?php
$sql_show = "select a.*,b.*,c.* from user a
left join major b on a.major_id = b.major_id
left join faculty c on a.faculty_id = c.faculty_id";
if($_POST['Search'])
{
$sql_show.=" where (a.user_id_card like '%$txt_search%' or b.major_name like '%$txt_search%' or c.faculty_name like '%$txt_search%') ";
}