so i have a query that returns a bunch of rows.... i display the contents of the query into a table... one of the variables that the query returns is $title.... after each row is returned im wanting to store the $title variable into an array, so i can then access that array later... here is my code for storing $title into the array
while ($row = mysql_fetch_array($result_get_info))
{
extract($row);
echo "<tr><form method='post' action='cart.php'><input type='hidden' name='remove_id' value='$id'>
<td valign='top' width='40%'>$title</td>
<td valign='top' width='25%'>$author</td>
<td valign='top' width='15%'>$$price</td>
<td valign='top' width='10%'>$type</td>
<td valign='top' width='15%'><input type='submit' name='remove' value='Remove'></td></form></tr>";
$total_sale = $total_sale + $price;
$book_list[] = '$title';
}
the problem is that when i print out the array, all i get is $title, $title, $title, etc etc.... so the name of the variable is being stored in the array, not the value of the variable like i need... here is how im priting out the array
$index_limit = count($book_list);
echo "$index_limit";
for($index = 0; $index <= $index_limit; $index++)
{
echo "$book_list[$index]";
}
am i doing something wrong? or are you just not allowed to store variables inside arrays in php? any help would be appreciated