So you have all these values stored in $variable_row[id], right?
Assuming that's what you're saying, do this:
for ($i=0; $i<count($variable_row); $i++) {
$temp="variable_".$i;
$$temp=$variable_row[$i];
}
Now you will have $variable_1, $variable_2 and so forth. I hope I got
what you were trying to do. Lemme know if that works.
"Andrew.Martin" wrote:
>
> I'm using this function to check the value of specific fileds per row in the
> database.
> such as....
> $query = "SELECT * FROM $dbn WHERE status = 4";
> $result = mysql_query($query) or die("failed to connect to DB");
>
> while ($row = mysql_fetch_array ($result)) {
> print "row id = $row[id]";
> print "decription in row = $row[description]";
> }
>
> this works fine, it checks the DB for values with status = 4 and prints row
> id and row description
>
> My problem occurs when I want to creat variables based on these results.
>
> I would ideally like to create dynamic variables based on row_id number e.g.
>
> variable_row[id] = $row[description]
>
> so later in the dynamically created page I could enter $variable_1 (1 being
> the row[id] value) and the correct value would be selected. Is there anyway
> of doing this? I tried using $$variable etc but no luck.
>
> Any ideas appriciated.
> Andrew
--
Paul Smith
[EMAIL PROTECTED]
http://www.dostuff.net
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]