I am having issues with my PHP while statement. It is:
$row = mysqli_fetch_array($result);
$time_in_12_hour_format = date("g:i a", strtotime($row['Time']));
while($row = mysqli_fetch_array($result)){ //Creates a loop to loop through results
echo "<tr><td>" . $row['Name'] . "</td><td>" . $row['Description'] . "</td><td>" . $row['Date'] . " at " . $time_in_12_hour_format . "</td><td>" . $row['Location'] . "</td>"; //$row['index'] the index here is a field name
Yes, I do realize I'm defining $row twice, but I'm not sure how to change that. If I remove $row = mysqli_fetch_array($result) from the while statement, the page will not load and it returns errors. As of now, the page loads but the table is empty, even though I know for a fact there is one record in there that was displaying in the table before I added my military time converter. Any help is appreciated.