MySQL Forums
Forum List  »  PHP

how to add url to values populated in a dropdown list from a mysql table column to open another page
Posted by: Rumila C
Date: October 21, 2012 11:41AM

Hello
I have a problem.
I need to add url to values populated in a dropdown list from a mysql table column to open another page.

I have been able to populate the values but i dnt know how to add url to each value.
My code is below:

<?
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "walters";
$table_name="Movies";


$con = mysql_connect($mysql_hostname,$mysql_user,$mysql_password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db($mysql_database, $con);

$query="SELECT Movie_ID, Movie_Name FROM Movies";
$result = mysql_query ($query);
echo "<select name=Movies value=''></option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[Movie_ID]>$nt[Movie_Name]</option>";
}
echo "</select>";
?>


Please help me out.
Thank You

Options: ReplyQuote


Subject
Written By
Posted
how to add url to values populated in a dropdown list from a mysql table column to open another page
October 21, 2012 11:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.