I have a mysql database with 2 clips in it. This is the code which show me the clip
if( $result = mysqli_query($con, "SELECT Widget FROM clipuri WHERE Data='$data[mday].$data[mon].$data[year]'", MYSQLI_USE_RESULT))
$row = mysqli_fetch_array($result);`
And that code show the clip in html
<table border="0">
<tr><td><?php echo $row['Widget']; ?></td></tr>
</table>
How to make a repeat function to show me all clips from that database?!
You must use a while loop in your code.
echo '<table border="0">';
while ($row = mysqli_fetch_array($result))
{
echo '<tr><td>'.$row['Widget'].'</td></tr>';
}//while
echo '</table>';
Get all rows with while loop and echo them.
3 in a row:
$counter = 0;
echo '<table border="0">';
while ($row = mysqli_fetch_array($result))
{
if($counter % 3 == 0)
{
echo '<tr>';
}
$counter++;
echo '<td>'.$row['Widget'].'</td>';
if($counter % 3 == 0)
{
echo '/<tr>';
}
}//while
echo '</table>';
Try:
while($row = mysqli_fetch_array($result)){
...
}