Re: php, DB and arrays
| From: | Mihail Bota | Date: | Sun, 10 Nov 2002 07:27:47 +0000 |
| Subject: | Re: php, DB and arrays | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23175@lists.php.net to get a copy of this message | ||
did you try "select max(v) as max_v from your_table where year=..." ?
and put this query in a loop for years.
mihai
On Sun, 10 Nov 2002, Martin Allan Jensen wrote:
> Hi evryone....i have a problem that i hope you can help me with.
>
> Here it goes!
>
> I have two arrays returned from my DB one called "y" adn one called "v"
> Togeather they hold a year(Y) and a value(V)
>
> The return from the DB looks like this:
>
> v:
> 10
> 20
> 40
> 60
> 320
> 780
> 890
> 920
>
> y:
> 2002
> 2002
> 2002
> 2002
> 2002
> 2003
> 2003
> 2003
>
> ---------
>
> Y represents a climping value
> A represents the year of the value
> --------------------------------
>
> So the values 10, 20, 40, 60, 320 etc. grows until a new year is reachet. And then it schould
> start again in the new year.
> So MAXIMUM ONE VALUE per year....
>
> How can i make it return this out of the earlier menchent array :
>
> (Arrays)
> Y:
> 2002
> 2003
>
> V:
> 320
> 920
>
> So much thanks people....i tried now for two days and i just can't come up with
> anything...
>
> P.S. Sorry for my bad english!
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>