This isn't so much of a MySQL question as it is a PHP (or ASP or whatever)
question.

At any rate, probably the best way to do this is with nested FOR loops. In
PHP, it would look something like this:

mysql_select_db("database_name");
$qry = "select country_name from table_name where [...conditions...]";
$result = mysql_query($qry)
$number_of_results = mysql_num_rows($result)
if ($number_of_results >= 1)
    {
    for ($i = 0; $i < $number_of_results; $i = $i + 3)
        {
        echo "<tr>/n"
        for ($i2 = 0; (($i2 < 3)||(($i + $i2) <= $number_of_results));
$i2++)
            {
            $record_id = ($i + $i2);
            echo "<td>".$result[$record_id]."</td>\n";
            }
        echo "</tr>\n"
        }
else
    {
    echo "<tr><td>The database did not resurn any records.</td></tr>";
    }

----- Original Message -----
From: "saraswathy saras" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 2:51 AM
Subject: listing data form database


> hai
>
> Can anybody help me? I'am query out data(country name) from database,total
> count of country if 100.Now i want to arrange the country's name by 3
> column() not long list.It should be
> example:
>
> <tr><td>Antigua</td><td>Australia</td><td>Austria</td></tr>
> <tr><td>Barbados</td><td>Belgium</td><td>Brazil</td></tr>
> <tr><td>Bulgaria</td><td>Canada</td><td>China</td></tr>
>
> It's possible?
>
>
> thanks in advance.
>
>
>
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to