Answered step by step
Verified Expert Solution
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', echo "
srttotime($row['date'])) . "" . $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 =number_format($total)?>