I think what you want is a variable variable name?
You can do it like this:
$varname = "foo";
// This loops generates a bunch of data.
// This may be something similar to what the form will post, or to make the form itself.
for($walker = 0; $walker < 10; $walker++)
{
$curvar = $varname . $walker;
${$curvar} = "bar " . $walker;
}
// This loop is to retrieve those values.
for($walker = 0; $walker < 10; $walker++)
{
$curvar = $varname . $walker;
echo "Name: " . $curvar . " || Value: " . ${$curvar} . "<br>";
}
Keep in mind, there is a difference between UPDATE and INSERT.
I say this because your post was a little unclear as to what you are trying to do.
Also, wise use of arrays (PHP is incredibly strong in dealing with arrays) may elminiate the need for the method above.
You can do it like this:
An html form:
for($walker = 0; $walker < 10; $walker++)
{
echo "<input name=\"name[]\" value=\"" . $walker . " text\"><br>";
}
Recieving page does not need to know the name:
it has an array of $name[]
In the first situation, you don't need to know the whole name, because you can figure it out.