I used to pass a the $result of a pg_query to a function which detects
min, max etc.
Now, I inserted before that another query which first queries a set of
parameters for the selected regions. Only if these parameters are
fulfilled for each of the regions, the values of the above query shall
be analyzed. Otherwise, they should be set to "NULL".
Now, as I am sending the ($result) to the function, I wonder if I can
change the values within the $result; or create a new $result based on
a couple of PHP-IFs?
Here is how it looks like:
Here is a query to retrieve the values for the selected regions and a
couple of years:
$result = pg_query("....");
The "result" looks like this:
| 1999 | 2000 | 2001 ....
A | 23 | 24 | 23
B | 12 | 15 | 18
Here is a query which load a couple of parameters:
$result_params = pg_query("....");
Here I would like to check:
IF param1 < 75 THEN region-in-$result-should-be-set-to-NULL
>> Here I would like to check:
>> IF param1 < 75 THEN region-in-$result-should-be-set-to-NULL
> Not sure I get what all you're wanting to do from your message, but
> could you use a case statement in sql to do this? Or put it in the
> where clause?
I knew it too be a bit complicated to explain....
Basically, it's more a PHP question, I guess. And that is if there is
a way to "infiltrate" the $result and change values within. Something