php - Assign variable to array values and populate <td> -
i have following code inside while loop following mysql query:
$values=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30); echo "<tr> <td class='results'>$values</td> <td class='results'>working query</td> </tr>"
i need $values variable populate , increase 1 each row obtained query.
desired result:
1 | data 2 | data 3 | data
you didn't post while loop, assume how looks like. can add simple counter variable , increase every row returned db:
$i = 1; while ($row = mysqli_fetch_assoc($res)) { echo "<tr> <td class='results'>$i</td> <td class='results'>working query</td> </tr>"; $i++; }
Comments
Post a Comment