Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

trying to print $result in rows of a table

$
0
0
hello, i am trying to print the query $result, each in a row!!
but i am just getting the form of the table without values added to it..
the query works fine since it was outputting normally before adding the table code
any help !!
 
$result = mysqli_query($con, $sql) or die(mysqli_error());
$num_rows = mysqli_num_rows($result);
while ($row =  mysqli_fetch_array($result) && $i<$num_rows) {
?>
<tr>
<td><?php echo $row['DayTime'];?></td>
<td><?php echo $row['Calories'];?></td>
</tr>  
</table>
<?php
$i++;
}

Viewing all articles
Browse latest Browse all 13200

Trending Articles