<?
$username="*************";
$password="***************";
$database="****************";
mysql_connect("***************",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT product_name, url FROM product WHERE product_name like 'Day You Were%' group by product_name order by product_name";
echo "<form action=\"https://www.paypal.com/cgi-bin/webscr\" target=\"paypal\" name=\"mygallery\" method=\"post\">";
/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */
$result = mysql_query ($query);
echo "<font color=\"#FF0000\">1.</font> Select The Gift You Would Like:<br><select name=\"gift\" onChange=\"go()\">";
// printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
[B]echo "<option label=\"$nt[product_name]\" value=\"$nt[url]\">$nt[product_name]</option>";[/B]
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>
In the drop down above I have the following options showing: Day You Were Born, Day You Were Married, Day You Were Christened. I want to select the correct option in the list according to the page the drop down appears on i.e I want the drop down to show 'Day You Were Marriedat the top of the list when the Day You Were Married page is displayed, Day You Were Born at the top of the list when the day you were born page is displayed and 'Day You Were Christened' at the top when the day you were christened page is displayed. So really what I am after is someone who can help with reordering the results according to the page it is on.
Can Anybody help????