Posted by Garry Jones on 04/13/06 13:50
I have an entry page which can be used to key in data for ten people. My
assigned variables for each field are in line with
$personage1
$personage2
....etc
$personage9
$personage10
and so on. (I have 8 fields for every person, 80 values in all).
To simplify my code and make changes easier I would like to create and use
these variables with a variable "x" in the name
This by recycling the code with $personX in and changing the value of x and
running the code ten times. Probably in some kind of do while loop (fairly
new to php, but I have been using Excel VB for years and am familiar with
the syntax and effectiveness of Do While Loops).
1) how do I put a variable in a variable name?
2) syntax for a do while loop with this variable name.
The beauty is if I can get this working I can make x=1 the first time adding
one each time and using value of X in my while statement.
Garry Jones
Sweden
[Back to original message]
|