简体   繁体   English

使用where子句创建自定义视图的问题

[英]Issue with creating a custom view with where clause

I've created a page using PHP as a front end for my database. 我已经使用PHP作为数据库的前端创建了一个页面。 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. 它运行正常,我在WSQL中使用WHERE子句创建了一个查询,该查询运行得很好,但是在PHP上,它不允许我在自定义视图中保存该查询。

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. 但是在PHP上,我无法做到这一点。

I use PHP Maker to create front end. 我使用PHP Maker创建前端。

Below is the SQL Code of my Query 以下是我的查询的SQL代码

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}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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