Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in PHP, tying SQL into this. Keep getting this error caught TypeError: mysqli_fetch_array(): Argument #1 ($result) must be of type mysqli_result, bool given

    • This is in PHP, tying SQL into this. Keep getting this error "caught TypeError: mysqli_fetch_array(): Argument #1 ($result) must be of type mysqli_result, bool given" this is talking about the line where the while statement is indicated


      while($row = mysqli_fetch_array($query,MYSQLI_ASSOC))
      {
      echo "";
      echo "" . $CUST_ID . "";
      echo "" . $row['name'] . "";
      echo "" . $row['item'] . "";
      echo "" . date('F, D, Y',
      srttotime($row['date'])) . "echo "" . $amount = $row['amount']
      == 0 ?'' : number_format($row['amount']) .
      "";
      echo "";




      //use the data function to convert the db date format to a more presentable format
      //d is for a two digit date, 01 to 31
      //f is for the full text of the momnth, January, ect.
      //y is the four digit year, 2018, ect. -->

      //the second argument, strtotime() function converts date (yyy-mm-dd) to UNIX timestamp, which is a requirment of using the date function-->


      $total += $row['amount']; //creating a sum
      $CUST_ID++; //increment operator
      }?>



      TOTAL







 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

The error message youre encountering indicates that the variable query is returning a boolean value false instead of a mysqliresult object This can happen if theres an issue with your SQL query Here a... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Project Management A Managerial Approach

Authors: Jack R. Meredith, Samuel J. Mantel,

7th Edition

470226218, 978-0470226216

More Books

Students also viewed these General Management questions

Question

How could a timer be used to compute the current time?

Answered: 1 week ago

Question

What was the result of this effort?

Answered: 1 week ago