PHP loop through database and limit number of entries

Hi,
Going to try to explain this as best I can. I have a bunch of stuff in a database and I need to display this info within a table. This isn't a problem at all but, I need it to only display 3 td tags per line and then move on to the row.

so i need it to do :

code:
My First Row My First Row 2 My First Row 3
My Second Row My Second Row 2 My Second Row 3


and continue to do this through every entry in the database table.

so I have something like this that will display the info:

code:

for ($i = 1; $i <= $num; $i++){

$chairArray = mysql_fetch_array($chairResult);
$chairName = $chairArray['name'];
$chairDescription = $chairArray['description'];
$chairImage = $chairArray['image'];

echo "<tr>";
echo "";
echo "image";
echo "
";
echo $chairName;
echo "";
echo "";


}

Thanks & regards
Lokananth
[url=http://www.mioot.com]Live Chat Software[/url] By miOOt

Comments

  • Simpply introduce new tags like;

    echo "";
    echo "";
    echo "image";
    echo "
    ";
    echo $chairName;
    echo "";

    [color=Purple]echo "";
    echo $chairName;
    echo "";

    echo "";
    echo $chairDescription;
    echo "";
    [/color]



    echo "";
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion