Re: Trying to subtract...no luck. (Long Code)
| From: | Chuck Theobald | Date: | Wed, 24 Oct 2001 21:05:19 +0000 |
| Subject: | Re: Trying to subtract...no luck. (Long Code) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72163@lists.php.net to get a copy of this message | ||
Another way to accomplish this, preferred in my mind, is:
while ($myrow = db_fetch_array($result)) :
while (list($key,$val) = each($myrow)) :
$$key = $val;
endwhile;
$difference = $budget - $actual;
. . .
endwhile;
Chuck
At 1:34 PM -0700 10/24/01, Jim Lucas wrote:
>one problem on the second script you are trying to use variables that are in
>an array.
>
>if this is where you are talking about
>you need to specify the array[key]
>
>> while ($myrow=DB_fetch_array($result)){
>>
>>
>> $difference = ($budget - $actual);
>
>$difference = ($myrow[budget] - $myrow[actual]);
>
Chuck Theobald, Technology Manager
ERIC Clearinghouse on Educational Management
5207 University of Oregon, Eugene, OR, 97403-5207
800-438-8841
* 541-346-1662 (voice) * 541-346-2334 (fax) * 541-337-0182 (cell) *
* http://eric.uoregon.edu/ * mailto:ctheobald@eric.uoregon.edu *