I'm trying to create an alphabetical index from a MySQL database. Here's the code I have so far:
if ($_POST[RecipeSearch] == "")
{
echo 'A<br />';
$result = mysql_query("SELECT RecipeTitle FROM `Recipes` WHERE `RecipeTitle` LIKE 'A%'")
or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
echo $row[RecipeTitle] . "<br /><br />";
};
And repeated for every letter in the blooming alphabet. The routine works. What I would like to accomplish is to have a link associated with the list items. Here's the algorithm:
SQL generates a list;
click on one item;
set $RecipeSearth = $row[RecipeTitle];
jump to the next phase of the code, or would it be better to jump to another page?
I'm stymied. This should be simple, but I've complicated things.