我正在尝试在 webmin 中添加自定义命令,但收到以下错误消息:
execution error : called with 1 bind variables when 0 are needed
变量名是 startdate ,所以我在我的 sql 命令中尝试了以下内容:
BETWEEN '$startdate 00:00:00' AND '$enddate 23:59:59'
BETWEEN '? 00:00:00' AND '? 23:59:59'
BETWEEN ':1 00:00:00' AND ':2 23:59:59'
BETWEEN ? '00:00:00' AND ? '23:59:59'
BETWEEN ? AND ?
并用引号将其括起来,但没有一个替换为所需的变量。
完整的命令在这里
SELECT
calldate,
MAX(concurrent)+1 AS peakcount
FROM (
SELECT
DATE(a.calldate) as calldate,
COUNT(b.uniqueid) AS concurrent
FROM cdr AS a, cdr AS b
WHERE
a.calldate BETWEEN '2013-11-08 00:00:00' AND '2013-11-13 23:59:59'
AND (
(a.calldate<=b.calldate AND (UNIX_TIMESTAMP(a.calldate)+a.duration)>=UNIX_TIMESTAMP(b.calldate))
OR (b.calldate<=a.calldate AND (UNIX_TIMESTAMP(b.calldate)+b.duration)>=UNIX_TIMESTAMP(a.calldate))
)
AND a.uniqueid>b.uniqueid
GROUP BY a.uniqueid
) AS baseview
GROUP BY calldate
有什么想法我还能尝试吗?