gpt4 book ai didi

php - 如何在 mysql ajax 表编辑器中使用 IN 运算符

转载 作者:行者123 更新时间:2023-11-29 23:50:23 25 4
gpt4 key购买 nike

我在 mysql 中创建了一个查询:

select 
address,state,id
from
addressdata
where
address in (select address from addressdata group by address having count(*) > 1)

但我面临一个问题:如何使该查询在 Mysql Ajax 表编辑器中工作?

我通过以下方式定义了 mysql ajax 表编辑器中的列:

function initiateEditor()
{
$tableColumns['ID'] = array(
'display_text' => 'ID',
'perms' => 'VT',
);
$tableColumns['State'] = array(
'display_text' => 'State',
'perms' => 'VT',
);
$tableColumns['Address'] = array(
'display_text' => 'Address',
'perms' => 'VT',
'table_fun' => array(&$this,'formatLink'),
'view_fun' => array(&$this,'formatLink')
);
}

function formatLink($col,$val,$row)
{
$query1=mysql_query("select Address from addressdata group by Address having count(*) > 1") or die(mysql_error());
}

但这似乎不能像正常查询一样工作,请帮忙解决。

最佳答案

嗨,使用类似这样的东西可能对你有用

$this->Editor->setConfig('sqlFilters',"Address != '' and Address IN(select address from addressdata group by address having count(*) > 1)");

关于php - 如何在 mysql ajax 表编辑器中使用 IN 运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25686147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com