我需要为数组中的每个值执行数据库选择功能。参数theRequestApplicationName包含一个数组,如["fb","dropbox","twitter"]我需要选择功能,在下面提到的查询中,它应该类似于 application.name = 数组的每个值。请帮我解决这个问题ApplicationLogoutUrl = function (theRequestId, theRequestApplicationName, theRequestOrg, connection, res){ theQuery = "select org_uses_app.app_logout_url from application, org_uses_app where application.id=org_uses_app.application and application.name = --";}
3 回答
UYOU
TA贡献1878条经验 获得超4个赞
你的 sql 查询应该是这样的 -
//$array variable is your array name like below
// $array = ["fb","dropbox","twitter"];
theQuery = "select org_uses_app.app_logout_url from application, org_uses_app
where application.id=org_uses_app.application and application.name IN
('$array[0]','$array[1]','$array[2]')";
繁星淼淼
TA贡献1775条经验 获得超11个赞
查询的基本结构可以是
SELECT item FROM database.table WHERE firstCondition OR secondCondition
假设数据库被命名applications,具有apps以下属性的表id和name一条记录{id: 'fb', name: 'facebook'},php中的查询将是
SELECT app_logout_url
FROM applications.apps
WHERE id = fb OR name = facebook;
- 3 回答
- 0 关注
- 176 浏览
添加回答
举报
0/150
提交
取消
