Forum Moderators: coopster

Message Too Old, No Replies

showing msql results in colums and rows

         

dragongamer

7:22 pm on Apr 7, 2006 (gmt 0)

10+ Year Member



i am trying to make a way to show the result

reslt1 result2 result 3
rsult 4 result 5
ect..

shows 10 rows and 3 colums so 30 all together

so i want to display like this and show how may other pages, is there a way to do this i would post what i have tryed to do but it would be quite long.

coopster

9:23 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, dragongamer.

Yes, you can loop through the data and output the html in rows/columns. Where is the data coming from? Is that all there is, or is there more data? It seems you may be referring to more than just the initial 30 items in the result set you are displaying.

dragongamer

6:42 am on Apr 8, 2006 (gmt 0)

10+ Year Member



it is a table dispalying game info so far i have

echo "<table><tr>";
$count = 0;

while ($row = $db->sql_fetchrow($result)) {

//
//all code
//

$count++;
if ($count == 2) {
echo "</tr><tr>";
$count = 0;
}
}

echo "</table>";

coopster

7:25 pm on Apr 10, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Are you familiar with the Basics of extracting data from MySQL [webmasterworld.com]? Get your data, loop through and apply the technique demonstrated here:

Good PHP solutions to small problems [webmasterworld.com] (msg#4 Create a Dynamic Table from mysql result)