I have a table from which I populate a list box.
I need to display/edit the details of the particular record which I click on, which has to be retrieved from the same table from which the list box is populated. I need the correct coding for both the events. Both the events should be displayed in the same screen. I have developed the following code which populates the listbox, but does not retrieve the record which has been clicked in the list Box. Members are requested to kindly help me with the correct code.
<HTML>
<HEAD>
<body style="background:#80BFFF">
<H1><CENTER><u>VENDOR MASTER DATA MODIFICATION SCREEN</u></center></H1>
<html>
<body bgcolor=#ffffff>
<form action="amend2.php" action="get">
<name="row">
<table width=300 align=center>
<tr><td>VENDOR NAME:</td><td>
<?php
$hostname = "localhost";
$db_user = "root";
$db_password = "";
$database = "t2";
$db_table = "vendmast";
$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db($database,$db);
$query = "select vend_des From $db_table order by vend_des";
$results = mysql_query($query, $db) or die("Error performing query");
echo("<select name=\"selectItem\">");
while($row = mysql_fetch_object($results))
{
echo("<option value=>$row->vend_des</option>");
}
mysql_close($db);
?>
</td></tr>
<td></td><td><input type=submit></td></tr>
</table>
</form>
</body>
</html>
<?php
$hostname = "localhost";
$db_user = "root";
$db_password = "";
$database = "t2";
$db_table = "vendmast";
$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db($database,$db);
$query = "select vend_des From $db_table order by vend_des where vend_des='<option value=>$row->vend_des</option>'";
$results = mysql_query($query, $db) or die("Error performing query");
echo vend_des;
?>