我在此查询中遇到问题从不显示信息。
以下是代码:
$db = new DB();
$db->connect();
$query2 = $db->query('SELECT pagado FROM pedidos WHERE email='.$_POST["email"].'');
$row2 = $db->fetch_array($query2);
$query3 = 'SELECT instalado FROM pedidos WHERE email='.$_POST["email"].'';
$row3 = $db->fetch_array($query);
if ($row2["email"] == "S"){
echo "Su pedido se está instalando";
echo $resultado3;
}elseif ($row3["email"] == "S"){
答案 0 :(得分:0)
您从查询中提取pagado
并尝试与错误的电子邮件匹配
if ($row2["email"] == "S"){
它将是
if ($row2["pagado"] == "S"){
同时将您的查询更改为
<?php
$db = new DB();
$db->connect();
$query2 = $db->query("SELECT pagado FROM pedidos WHERE email='".$_POST['email']."'");
$row2 = $db->fetch_array($query2);
$query3 = "SELECT instalado FROM pedidos WHERE email='".$_POST["pagado"]."'";
$row3 = $db->fetch_array($query3);
if ($row2["pagado"] == "S"){
echo "Su pedido se está instalando";
echo $resultado3;
}elseif ($row3["instalado"] == "S"){
答案 1 :(得分:0)
没有变量,例如$query
所以
改变你的
$row3 = $db->fetch_array($query);
到
$ row3 = $ db-&gt; fetch_array($ query3);
您也可以更改两个查询并将其合并为一个
$query2 = $db->query('SELECT pagado,instalado FROM pedidos WHERE email='.$_POST["email"].'');
$row2 = $db->fetch_array($query2);