gpt4 book ai didi

php - 带有 mt_rand 的 Var_Dump

转载 作者:行者123 更新时间:2023-11-30 22:05:29 24 4
gpt4 key购买 nike

以下语句未返回任何结果。我检查了 SQL 语句,它们是正确的,而且似乎没有编码错误。

<?php

require_once "func.php";
require_once "websockets.php";

// private $curResultId;
// private $MaxResult;
// private $MinResult;

for( $i = 0; $i<5; $i++ ) {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '1'
and ResultPackage.PackageID like '1'
ORDER BY resultid desc LIMIT 1");
$this->MaxResult = $row['resultid'];


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

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


var_dump($this->curResultId);


}

?>

请帮忙

最佳答案

什么是$this?这是类方法的一部分还是您的全部脚本?如果它不是一个类,你应该使用其他变量而不是 $this

for($i=0; $i<5; $i++) {
$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '1'
and ResultPackage.PackageID like '1'
ORDER BY resultid desc LIMIT 1");
$MaxResult = $row['resultid'];

$row = db_fetch_item("SELECT resultid FROM ResultPackage
where ResultPackage.slotid like '1'
and ResultPackage.PackageID like '1'
ORDER BY resultid asc LIMIT 1");
$MinResult = $row['resultid'];

$curResultId = mt_rand($MinResult,$MaxResult);

var_dump($curResultId);
}

关于php - 带有 mt_rand 的 Var_Dump,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41904840/

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