Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP缓存显示MySQL临时表的结果?_Php_Mysql_Caching - Fatal编程技术网

使用PHP缓存显示MySQL临时表的结果?

使用PHP缓存显示MySQL临时表的结果?,php,mysql,caching,Php,Mysql,Caching,我目前遇到一个问题,MySQL在PHP页面中创建的动态临时表中只显示了我的3行中的1行。我可以通过以下方式确认TmpTable有多少行: $numrows = mysqli_num_rows($doResults); (返回3) 但是当我在($rows=mysqli_fetch_array($doResults)){}时,只返回/显示3行中的1行。一行正确返回,所有字段都被请求 是否有人在缓存等方面有任何问题 返回结果集中的下一条记录,仅返回一条记录。变量$rows的名称表明您的预期不是这样

我目前遇到一个问题,MySQL在PHP页面中创建的动态临时表中只显示了我的3行中的1行。我可以通过以下方式确认TmpTable有多少行:

$numrows = mysqli_num_rows($doResults);
(返回3)

但是当我在($rows=mysqli_fetch_array($doResults)){}时,只返回/显示3行中的1行。一行正确返回,所有字段都被请求

是否有人在缓存等方面有任何问题

返回结果集中的下一条记录,仅返回一条记录。变量$rows的名称表明您的预期不是这样

试试像这样的东西

error_reporting(E_ALL); // only for debugging
ini_set('display_errors', 1); // only for debugging

$numrows = mysqli_num_rows($doResults);
echo '<pre>debug: $numrows=', $numrows, "</pre>\n";
$dbgcRow = 0;
while($row=mysqli_fetch_array($doResults)) {
  // row counter / number of the current record
  echo '<pre>debug: $dbgcRow=', ++$dbgcRow, "</pre>\n";
  // print the values of the current record
  echo htmlentities(join(',', $row)), "<br />\n";
}
错误报告(E_ALL);//仅用于调试
ini_集('display_errors',1);//仅用于调试
$numrows=mysqli_num_行($doResults);
回显“调试:$numrows=”,$numrows,“\n”;
$dbgcRow=0;
while($row=mysqli\u fetch\u数组($doResults)){
//行计数器/当前记录的编号
echo“debug:$dbgcRow=”,++$dbgcRow,“\n”;
//打印当前记录的值
echo htmlentities(join(“,”,$row)),“
\n”; }
尝试发布查询本身和/或更大的代码片段。包含查询和获取循环的内容。另外,如果您正在运行PHP5.3,请查看mysqli_fetch_all()。感谢您的快速回复。。。我最终解决了我的问题。我的while循环中有第二个while循环,它导致它在显示1行后退出。改为for循环,现在效果很好!再次感谢上帝保佑我