But, let's see if I can restate your problem in a way I can understand.
You have an array with 4 records that contain 2 fields each. (rec_id,rec_name) and you want to load these into variables.
One at a time? Or multiple variables so you can view them all at once?
Either way, I think a solution like this will work...
Oh, before I forget, take the @ from in front of your sql commands and you should begin getting error messages. I think.
Let's try this...
Your array looks like this...
$arraysample=("rec_id0" +>"a", "rec_id1" +>"b", "rec_id2" +>"c", "rec_id3" +>"d",);
<?
// load the array - you already have this done.
// Print $arraysample
echo "Sample Array:<BR>";
while(list($rec_id,$value) = each($arraysample)
{
echo "$rec_id : $value <BR>";
}
// Print values in $arraysample
$values = array_values($arraysample);
echo "<BR>Values From Your Array:<BR>";
while (list($rec_id,$value) = each($value))
{
echo $rec_id : $value<br>";
}
?>
This should give you output similar to what you want.
And, if not, then at least you have a place to start.