Want to use a database record ID field as array subscript
Posted: Fri Mar 13, 2009 12:42 pm
Hello,
Newbie alert!!
I have a very small database and need to use the automatic id field that is generated in the database as the subscript to an array.
For example:
$ct = $result_row["runnerid"];
$fname["$ct"] = $result_row["firstname"];
$lname["$ct"] = $result_row["lastname"];
The $result_row comes from the database. The runnerid is the ID field in each record. When I display $fname["ct"], the actual word "array" displays. I know the $result_row has the right values but I can't seem to get the $fname and $lname to work as arrays with the $ct as a subscript.
Any advice?
Newbie alert!!
I have a very small database and need to use the automatic id field that is generated in the database as the subscript to an array.
For example:
$ct = $result_row["runnerid"];
$fname["$ct"] = $result_row["firstname"];
$lname["$ct"] = $result_row["lastname"];
The $result_row comes from the database. The runnerid is the ID field in each record. When I display $fname["ct"], the actual word "array" displays. I know the $result_row has the right values but I can't seem to get the $fname and $lname to work as arrays with the $ct as a subscript.
Any advice?