Hey again everyone. Please keep in mind I'm new to PHP and programming as well, so this might be an obvious answer I'm missing. Any help, as always, is greatly appreciated.
I have a mysql_fetch_array result that produces 120 or so rows. To help make the resulting table more readable, I would like to insert a <hr>, or some graphic, after every 6th row of the resulting table. Any ideas how to do so? Here's the code I've got for the mysql_fetch_array.
Which produces this result:Code:echo '<table class="db_t_res">\n'; if($result) { while($row = mysql_fetch_array($result)) { echo '<tr>\n <td style="width:10%;">'. echo $row['year']; echo '</td>\n <td style="width:30%;">'; echo $row['industry']; echo '</td>\n <td style="width:60%;">'; echo $row['emissions']; echo '</td>\n </tr>\n'; } } echo '</table>\n';
Code:Year Industry MMTCO2 Emissions 1990 All 95.36 1990 Commercial 4.34 1990 Electric 23.08 1990 Industry 19.94 1990 Residential 6.50 1990 Transportation 41.50 1991 All 96.42 1991 Commercial 4.09 1991 Electric 25.12 1991 Industry 20.32 1991 Residential 6.39 1991 Transportation 40.50 1992 All 97.68 1992 Commercial 4.52 1992 Electric 26.69 1992 Industry 19.27 1992 Residential 6.97 1992 Transportation 40.24 1993 All 102.25 1993 Commercial 4.92 1993 Electric 31.25 1993 Industry 17.69 1993 Residential 7.17 1993 Transportation 41.22 1994 All 101.21 1994 Commercial 4.98 1994 Electric 29.16 1994 Industry 18.05 1994 Residential 7.10 1994 Transportation 41.91
I want the results to look something like this:
Code:Year Industry MMTCO2 Emissions 1990 All 95.36 1990 Commercial 4.34 1990 Electric 23.08 1990 Industry 19.94 1990 Residential 6.50 1990 Transportation 41.50 ___________________________ 1991 All 96.42 1991 Commercial 4.09 1991 Electric 25.12 1991 Industry 20.32 1991 Residential 6.39 1991 Transportation 40.50 ___________________________ 1992 All 97.68 1992 Commercial 4.52 1992 Electric 26.69 1992 Industry 19.27 1992 Residential 6.97 1992 Transportation 40.24 ___________________________ 1993 All 102.25 1993 Commercial 4.92 1993 Electric 31.25 1993 Industry 17.69 1993 Residential 7.17 1993 Transportation 41.22 ___________________________ 1994 All 101.21 1994 Commercial 4.98 1994 Electric 29.16 1994 Industry 18.05 1994 Residential 7.10 1994 Transportation 41.91


Reply With Quote
Bookmarks