gpt4 book ai didi

php - Rand(Min, Mx) undefined variable

转载 作者:太空宇宙 更新时间:2023-11-03 11:40:49 25 4
gpt4 key购买 nike

您好,我有以下代码:

private function doPreEventStart($user) {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '%{$this->curSlotId}'
and ResultPackage.PackageID like '%{$user->packageid}%'
ORDER BY resultid desc LIMIT 1");
$this->MaxResult = $row['resultid'];


$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '%{$this->curSlotId}'
and ResultPackage.PackageID like '%{$user->packageid}%'
ORDER BY resultid asc LIMIT 1");
$this->MinResult = $row['resultid'];

$this->curResultId = rand($MinResult,$MaxResult);
}

但是我收到了这个错误:

PHP Notice: Undefined variable: MinResult in /var/www/html/betserver.php on line 539

PHP Notice: Undefined variable: MaxResult in /var/www/html/betserver.php on line 539

请帮忙

最佳答案

修复第 539 行以引用您刚刚创建的类变量:

$this->curResultId = rand($this->MinResult, $this->MaxResult);

(注意每个之前添加的$this->)

关于php - Rand(Min, Mx) undefined variable ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41899102/

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