SELECT t_personal.*, t_personal_data.*, t_smena.*, t_subdivision.*, t_subdivision_name.*, t_duty.*, t_duty_name.*
FROM t_personal, t_personal_data, t_smena, t_subdivision, t_subdivision_name, t_duty, t_duty_name
WHERE t_personal.id_tab_number LIKE '%".mysql_real_escape_string($id_tab_number)."%'
AND t_personal.id_tab_number = t_personal_data.id_tab_number
AND t_personal.id_tab_number = t_smena.id_tab_number
AND t_personal.id_tab_number = t_subdivision.id_tab_number
AND t_subdivision.id_subdivision = t_subdivision_name.id_subdivision
AND t_personal.id_tab_number = t_duty.id_tab_number
AND t_duty.id_duty = t_duty_name.id_duty;
Как это не удивительно но он работает.
А нужно что бы он выглядил так:
SELECT t_personal.*, t_personal_data.*, t_smena.*, t_subdivision.*, t_subdivision_name.*, t_duty.*, t_duty_name.*
FROM t_personal, t_personal_data, t_smena, t_subdivision, t_subdivision_name, t_duty, t_duty_name
WHERE t_personal.id_tab_number LIKE '%".mysql_real_escape_string($id_tab_number)."%'
OR t_personal.name_1 LIKE '%".mysql_real_escape_string($id_tab_number)."%'
AND t_personal.id_tab_number = t_personal_data.id_tab_number
AND t_personal.id_tab_number = t_smena.id_tab_number
AND t_personal.id_tab_number = t_subdivision.id_tab_number
AND t_subdivision.id_subdivision = t_subdivision_name.id_subdivision
AND t_personal.id_tab_number = t_duty.id_tab_number
AND t_duty.id_duty = t_duty_name.id_duty;
Но входит в ступор и пипец……