View Full Version : duplicating a row

10-01-2004, 04:21 AM
I have a column in my table that holds a variable number. and I want to display the query results for that whole row as many times as the number that is stored in that column for that row.

Meaning if row has 4 for the column it will echo/print that row 4 times. How can I do this?? :confused:

10-01-2004, 08:17 AM
Depends on formatting of course, but...


while ($row = mysql_fetch_assoc($result)) {

for ($x = 0; $x <= $row["column_name_of_variable_number"]; $x++ ) {
/* print out the results, ie: echo $row["column3"]; */


... indicate assumed code.