gpt4 book ai didi

php - 将 select_query 更改为 mysql_query?

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

这是我的 select_query 正在使用的代码行:

$result = select_query("tblaffiliatespending", "SUM(tblaffiliatespending.amount)", array("affiliateid" => $id), "clearingdate", "DESC", "", "tblaffiliatesaccounts ON tblaffiliatesaccounts.id=tblaffiliatespending.affaccid INNER JOIN tblhosting ON tblhosting.id=tblaffiliatesaccounts.relid INNER JOIN tblproducts ON tblproducts.id=tblhosting.packageid INNER JOIN tblclients ON tblclients.id=tblhosting.userid");

这是它使用的语法:

select_query($table,$fields,$where,$sort,$sortorder,$limits,$join) 

您可以在此处查看相关文档:http://docs.whmcs.com/SQL_Helper_Functions

任何人都可以弄清楚如何将 select_query 更改为我可以在 Smarty 模板系统中使用的普通 mysql_query 吗?我一直在尝试大量不同的方法,但所有方法都返回一个空白数组...任何帮助将不胜感激!

最佳答案

我不知道您要做什么,但此代码构建的查询如下:

SELECT SUM(tblaffiliatespending.amount) 
FROM tblaffiliatespending
JOIN tblaffiliatesaccounts ON tblaffiliatesaccounts.id=tblaffiliatespending.affaccid
INNER JOIN tblhosting ON tblhosting.id=tblaffiliatesaccounts.relid
INNER JOIN tblproducts ON tblproducts.id=tblhosting.packageid
INNER JOIN tblclients ON tblclients.id=tblhosting.userid
WHERE affiliateid=$id
ORDER BY clearingdate DESC

关于php - 将 select_query 更改为 mysql_query?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22129373/

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