how do I dispaly results like this

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
achintha
Forum Newbie
Posts: 13
Joined: Mon Apr 30, 2007 10:21 am

how do I dispaly results like this

Post by achintha »

I want to know if we want to dispaly results like this how i do it.

Sample:
Results
1
2
3
4
5
6

this is normal way. I wna to know how I do dispaly like following way

1 2
3 4
5 6

please help me
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I suppose you mean getting the results in a formatted table? There's a lot of info on these boards about this in the "useful posts" topic or if you search the boards.

Otherwise if you just want two results per line.. just use a loop like the following.

Code: Select all

$i = 0;
while ($whatever)
{
    if ($i == 2)
    {
        echo '<br />' . "\n";
        $i = 0;
    }

    echo $result;
    $i++;
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply