MySQL Forums
Forum List  »  PHP

GEtting the value of a selected listbox item
Posted by: Intellect Research
Date: June 18, 2013 05:37AM

<?php

//Establish connection


$query = "SELECT Matric_No FROM civil_2005_2006_sem1_yr1" or die (mysql_error());
$sql = mysql_query($query);

print "<p>Select MatNo: \n";
print "<select name=\"MatricNo\" > \n";

while ($row = mysql_fetch_array($sql))
{
$Matric_No = $row["Matric_No"];
// Echo your rows here...
print "<option value=$Matric_No>$Matric_No\n";
}
print "</select>\n";

>?

Options: ReplyQuote




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.