-1

Attempting to create display order page for admin, but getting this error in my code. I am not getting the error after so much effort. help me!!

Error: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result

Here's my Code:

      <div class="grid_10">
        <div class="box round first">
            <h2>Display Order</h2>
              <div class="block">
               
                <?php
                $res = mysqli_query($link, "select * from 'confirm_order_address' order by id desc");
                echo "<table border='1'>";
                echo "<tr>";
                echo "<td style='font-weight:bold'>"; echo "fullname"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "mobileno"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "email"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "pincode"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "address"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "landmark"; echo "</td>";
                echo "<td style='font-weight:bold'>"; echo "city"; echo "</td>";
                echo "</tr>";
                
                while($row = mysqli_fetch_array($res))
                {
                    echo "<tr>";
                    echo "<td>"; echo $row["fullname"]; echo "</td>";
                    echo "<td>"; echo $row["mobileno"]; echo "</td>";
                    echo "<td>"; echo $row["email"]; echo "</td>";
                    echo "<td>"; echo $row["pincode"]; echo "</td>";
                    echo "<td>"; echo $row["address"]; echo "</td>";
                    echo "<td>"; echo $row["landmark"]; echo "</td>";
                    echo "<td>"; echo $row["city"]; echo "</td>";
                    echo "</tr>";
                }
                echo "</table>";
                
                ?>
                
            </div>
        </div>
     </div>
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • table names must not be enclosed in single quotes. Use `select * from confirm_order_address order by id desc` – Nick Dec 19 '20 at 06:37

1 Answers1

-1
<div class="grid_10">
    <div class="box round first">
        <h2>Display Order</h2>
          <div class="block">
           
            <?php
            $sql_select = 'SELECT * FROM confirm_order_address ORDER BY id DESC';
            $result_select = $link->query($sql_select);
            if ($result_select->num_rows > 0) {
            echo "<table border='1'>";
            echo "<tr>";
            echo "<td style='font-weight:bold'>"; echo "fullname"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "mobileno"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "email"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "pincode"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "address"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "landmark"; echo "</td>";
            echo "<td style='font-weight:bold'>"; echo "city"; echo "</td>";
            echo "</tr>";
            
            while ($row_select = $result_select->fetch_assoc()) {
                echo "<tr>";
                echo "<td>"; echo $row["fullname"]; echo "</td>";
                echo "<td>"; echo $row["mobileno"]; echo "</td>";
                echo "<td>"; echo $row["email"]; echo "</td>";
                echo "<td>"; echo $row["pincode"]; echo "</td>";
                echo "<td>"; echo $row["address"]; echo "</td>";
                echo "<td>"; echo $row["landmark"]; echo "</td>";
                echo "<td>"; echo $row["city"]; echo "</td>";
                echo "</tr>";
            }

            echo "</table>";
            }
            ?>
            
        </div>
    </div>
 </div>
Fahad Razi
  • 64
  • 1
  • 5