0

I have be struggling to turn the below while loop into a foreach loop with no result, so I am asking for help here on how to do this.

$query = "Select * from TIME_TABLE Where
Extract(month from DATE_FIELD ) = DATE_FORMAT(NOW(), '%c')
and
Extract(day from DATE_FIELD ) = DATE_FORMAT(NOW(), '%e')
order by DATE_FIELD, DESCRIPTION";
$result = $mysqli->query($query);

while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
    $dbItems .=  "<item> <record_num>" . $row['RECORD_NUM'] . "</record_num>" .
        "<date_field>" .   $row['DATE_FIELD'] . "</date_field>" .
        "<description>" .  $row['DESCRIPTION'] . "</description> </item>";
}
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by peter_budo
0

I placed this in the wrong group. I am moving this to PHP.
Sorry!

0

I placed this in the wrong group. I am moving this to PHP.
Sorry!

Next time please click on "Flag Bad Post" and write message like "Please move to PHP" and assign moderator will take care of it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.