Php 可缓存致命错误:类mysqli_result的对象无法转换为字符串
无法在第27行将类mysqli_result的对象转换为字符串 有人能解释一下如何修复这个错误吗,错误描述,我试图为一个朋友创建一个虚拟PHP商店,我试图做的是显示一个报价列表及其描述,我试图做的是从数据库获取数据以列出报价,代码一直在说这个错误,有人知道如何修复它吗Php 可缓存致命错误:类mysqli_result的对象无法转换为字符串,php,mysqli,Php,Mysqli,无法在第27行将类mysqli_result的对象转换为字符串 有人能解释一下如何修复这个错误吗,错误描述,我试图为一个朋友创建一个虚拟PHP商店,我试图做的是显示一个报价列表及其描述,我试图做的是从数据库获取数据以列出报价,代码一直在说这个错误,有人知道如何修复它吗 <?php //Offer Wall // Put your CPA Networks Virtual Currency Widget after the End of this first PHP //Segment
<?php
//Offer Wall
// Put your CPA Networks Virtual Currency Widget after the End of this first PHP
//Segment
include "mysqli_config.php";
?>
<table>
<tr>
<th>Offer Name</th>
<th>Description</th>
<th>Payout</th>
</tr>
</table>
<?php
$offername= "SELECT * FROM offers WHERE active = 1";
$exec= $mysqli->query($offername);
$array = array($exec);
if (mysqli_num_rows($exec) == 0){
echo "No Offers Yet";
}else{
while (list($x, $y, $z, $a) = $array){
echo " <tr>\n " .
" <td><a href=\"click.php?=$a\">Click Here to Open Offer</a></td>\n" .
" <td>$z</td>\n" .
" <td>$y</td>\n" .
" <td>$x</td>\n";
}}
?>
报盘名称
描述
支出
x,y,z,a和0,1,2,3必须更改以获得所需的结果,但这就是想法。错误在这一行:$array=array($exec)
报盘名称
描述
支出
签出此文件-
<?php
//Offer Wall
// Put your CPA Networks Virtual Currency Widget after the End of this first PHP
//Segment
include "mysqli_config.php";
?>
<table>
<tr>
<th>Offer Name</th>
<th>Description</th>
<th>Payout</th>
</tr>
</table>
<?php
$offername= "SELECT * FROM offers WHERE active = 1";
$exec= $mysqli->query($offername);
//$array = array($exec);
if (mysqli_num_rows($exec) == 0){
echo "No Offers Yet";
}else{
while ($array=mysqli_fetch_row($exec)){
$a=$array[3];
$x=$array[0];
$y=$array[1];
$z=$array[2];
echo " <tr>\n " .
" <td><a href=\"click.php?=$a\">Click Here to Open Offer</a></td>\n" .
" <td>$z</td>\n" .
" <td>$y</td>\n" .
" <td>$x</td>\n";
}}