Re: [PHP-DB] dividing an mysql_fetched_array...

2001-02-08 Thread Johannes Janson

Hi,,

no 3 sql isn't neccessary.
you could put an $i = 0 before the whlie loop and increment it at the end of
it.
Thus you could do it with an if.-caluse: if ($i=0) { ehco "ad"; }. Same
thing for
ads which go between newsarticle 8 and 9.

Good luck
otis


""Trond Erling Hundal"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there...
> I was thinking of dividing a front page displaying 15 newsarticles into
> three parts.
> The first part, will contain only one article...
> Below the first article there will be an ad, before to columns suceeding
> this banner displays 2*7 articles...
>
> how do I do this?
>
> I know the array has indexes of 0, 1 ,2 ,3 etc etc...
> But, of course, I am fetching out several different columns from the db,
> title, ingress, date etc etc...
>
> How do I tell the script to display one the *first* title, and then 7
> more... and then additional 7?
>
> I wan`t to avoid doing three sql`s... Or is this nescessary?
>
>
> -trond
>
>
> --
> 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]
>



-- 
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]




[PHP-DB] dividing an mysql_fetched_array...

2001-02-08 Thread Trond Erling Hundal

Hi there...
I was thinking of dividing a front page displaying 15 newsarticles into
three parts.
The first part, will contain only one article...
Below the first article there will be an ad, before to columns suceeding
this banner displays 2*7 articles...

how do I do this?

I know the array has indexes of 0, 1 ,2 ,3 etc etc...
But, of course, I am fetching out several different columns from the db,
title, ingress, date etc etc...

How do I tell the script to display one the *first* title, and then 7
more... and then additional 7?

I wan`t to avoid doing three sql`s... Or is this nescessary?


-trond


-- 
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]