...

View Full Version : duplicating a row



SWI03
10-01-2004, 03: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:

Celtboy
10-01-2004, 07: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.

HTH,
-Celt



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum