Hey there fellow querieres....
I summon your power! (eh..)

well.. enough with the nonsense :)

I have a littlebit of problem:

I am displaying 15 different newsarticles on a page.
The articles are displayed in three different tables.

First there`s one article (the main-top-story) that is shown in the top of
the page.
Then there is an ad.
And then. Below this ad, there are two columns, each displaying 7 articles

To avoid running multiple queries I do a $i = 0, and a $i++ before I end the
while statement...
($i increments for each time the while loops)

The articles can be divided into two distinct groups.
smallnews, and news, and this is stored in the article table in a field
named Kategory!

Here is the thingy:
I can`t have any smallnews desplaying their ugly faces in the first four
while loops...
That is: smallnes cannot be shown before 4 "real" newsarticles has been

How do I go about this without having to write a huge bunch of if/elses (I`m
not sure if that would even work).

==== some notes below to give you an idea of how I am thinking ====

while (.........) {

                if (($i < 4) && ($kategory == "smallnews")) {
                                $i == $i
                        continue ;
                } // Go around another time.....

        if (($i == 0) && ($kategory == "newsarticle")) {
                echo "<tr><td> etc etc..." ;
                } // End writing if it is the first article

Just some scribling here....

if ($kategory == "smallnews")
        continue ;

What do YOU think?


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to