I have a table in a database. The array has 4 records and each record has 4 fields. I load the 4 records on a DropDown List. When I select one record from the DropDown box , I can’t appear all the fields as object text but only one.
How should I appear all the fields in a different object text?
Please help !!!!!!!
<?php
$query = "SELECT * FROM tblStudies ORDER BY Study_Per";
$Studies = mysql_query($query);
?>
<body>
<br>
<br>
<FORM METHOD="POST" ACTION="form_x">
<div align="CENTER">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="705" height="563" id="AutoNumber1">
<tr>
<td width="130" height="35">
<p align="right">Study</td>
<td width="439" height="35">
<?
echo("<select name=\"Study\"
onchange=\"this.form.Study_PSHeader.value=this.options[this.selectedIndex].text;
this.form.Study_ProdSummary.value=this.options[this.selectedIndex].text;\"
>\n");
echo ("<OPTION SELECTED VALUE=\"\"Study=''>");
while ($Study = mysql_fetch_array($Studies)) {
$Study_Code = $Study["Study_Code"];
$Study_Descr = $Study["Study_Descr"];
$PSHeader = $Study["Study_PSHeader"];
$Study_ProdSummary = $Study["Study_ProdSummary"];
echo("<OPTION VALUE='$Study_Code'>$Study_Descr\n");
}
echo ("</select>\n");
?>
</select></td>
</tr>
<tr>
<td width="130" height="34">
<p align="right">Ps Header</td>
<td width="439" height="34"><input type="text" name="Study_PSHeader" size="61">
</td>
</tr>
<tr>
<td width="130" height="108">
<p align="right">Prod <font size="2" face="Tahoma">Summary</font></td>
<td width="439" height="108"><textarea rows="7" name="Study_ProdSummary" cols="52"></textarea></td>
</tr>
</DIV>
</FORM>
</BODY>
</HTML>