MarriaDB PHP mysqli_fetch_array replacement using in MariaDB

Viewed 23

what i am wanting to accomplish is to remove the comment on the lines and find a replacement for the $res = mysqli_fetch_array($result)) this statement does not work in MariaDB, anyone have any Idea's on what to use here

thank you so much

   <?php

    //  mysql_fetch_array
    //  while($res = mysqli_fetch_array($result)) {     

    //      $stat=$res['trolleyid'];
    //      if($stat=="000000")
    //      {
    //          $color="color:red";
    //          $text="BAD READ";
    //      }
    //      else 
    //      {
    //          $color="color:green";
    //          $text="GOOD READ";
    //      }

   while($row = $result->fetch(PDO::FETCH_ASSOC)) {         
      echo "<tr>";
      echo "<td>".$row['id']."</td>";
      echo "<td>".$row['datecol']."</td>";
      echo "<td>".$row['timecol']."</td>";
      echo "<td>".$row['trolleyid']."</td>";    
      echo "<td style='$color'>".$text."</td>"; 
  }

   ?>

   </table>
</body>
</html>
0 Answers
Related