简体   繁体   中英

Issue with creating a custom view with where clause

I've created a page using PHP as a front end for my database. It is working properly, I have created a query in MYSQL with the WHERE clause and it runs perfectly but on PHP, it did not allow me to save that query in Custom View.

I need that query because I want end users to enter the team name to get the list of their desire team. But on PHP, I am not able to do that.

I use PHP Maker to create front end.

Below is the SQL Code of my Query

SELECT
emp_details_ees.Employee_Code,
emp_details_ees.Employee_Name,
post.Emp_Post,
designation.Employee_Designation,
team.Emp_Team,
base_station.Base_Station,
region.Region,
zone.Zone,
emp_details_ees.Employee_Company_Number,
emp_details_ees.Employee_Comapny_Email,
`status`.Emp_Status,
emp_details_ees.Employee_Personal_Address
FROM
base_station
INNER JOIN emp_details_ees ON emp_details_ees.Employee_Base_Station = base_station.basestation_id
INNER JOIN post ON emp_details_ees.Employee_Post = post.emppost_id
INNER JOIN designation ON emp_details_ees.Employee_Designation = designation.empdesignation_id
INNER JOIN region ON emp_details_ees.Employee_Region = region.region_id
INNER JOIN `status` ON emp_details_ees.Employee_Status = `status`.empstatus_id
INNER JOIN team ON emp_details_ees.Employee_Team = team.empteam_id
INNER JOIN zone ON emp_details_ees.Employee_Zone = zone.zone_id
WHERE
`status`.Emp_Status = 'Active' AND team.Emp_Team = [$Emp_Team]
ORDER BY
base_station.station_sortid ASC,
designation.designation_sortdid ASC;

If you could help me to clear out the confusion.

在您的WHERE子句中将[$ Emp_Team]更改为{$ Emp_Team}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM