I dont understand why when I use a select query, such as "select from group_index", it lists the information correctly, it goes to the correct page for my choice, but then when I echo the varible that stored my query on the next page, it records the last listing for an example, in the following code, I selected the first listing, on the next page, it listed the correct information for my choice, but if I echo $album_id, it says -4 instead of the correct -1
<?
$db=mysql_connect("localhost","root","***********") or die("Server could not be connected");
$mydb=mysql_select_db("photos") or die("Database could not be connected");
echo"<form method=post action=Browse_Photos.php>";
$query="select * from `$album_id`";
$res=mysql_query($query) or die("Error");
echo" <table border=4 cellpadding=2 cellspacing=2 align=center width=100%>";
while($row=mysql_fetch_array($res)){
echo" <tr>";
echo" <td>";
$album_id=$row["album_id"];
echo" <input type=radio name=album_id value=$album_id> More Details";
echo" </td>";
echo" <td>";
$album_name=$row["album_name"];
echo $album_name;
$selected_album_id=$album_id;
$selected_album_name=$album_name;
echo" </td>";
echo" </tr>";
}
echo" </table>";
echo" <input type=submit name=options value='Submit'>";
echo" <input type=hidden name=id value='$album_id'>";
echo" <input type=hidden name=a_name value='$album_name'>";
echo" <input type=hidden name=group_id value='$group_id'>";
echo" <input type=hidden name=group_name value='$group_name'>";
echo" </form>";
?>
Thanks,
Campsoup1988
PS: any varibles listed with (such as$group_id`) is correct, the reson is that the table names are numbers so that mark is nessary