Forum Moderators: coopster

Message Too Old, No Replies

Stuck on variable

New idea is welcome

         

wkpride

7:47 pm on Mar 29, 2009 (gmt 0)

10+ Year Member



User input selects a record from the database.
The very first time, I want to keep $area as the "master area" as a non-changing variable.

In other words, The $Master Variable will always remain the same as the first record read.

That way I can change the "$area" to the $master if desired.

Seems like it would be pretty basic, but darned if I can get it to work.

Thanks!

KP

omoutop

6:06 am on Mar 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



assuming you are using a db to get area names..

$MasterArea = '';
$k = 0; // custom counter

// start looping to get db results
while (....)
{
$area = $row[''];
$k++;
if($k==1){$MasterArea=$area;}
}

Hope this makes sence

wkpride

12:31 am on Apr 1, 2009 (gmt 0)

10+ Year Member



Thank you. I'll give it a try!

Appreciated. kp