...

View Full Version : I badly neede answers



che_anj
08-23-2006, 04:38 AM
Heres the code:

$query="select p.sub_code,p.term, from prosdetails p, subject s,prospectus r where p.prosno='$prosno' and p.sub_code=s.sub_code and r.prosno=p.prosno";
$result=mysql_query($query);
echo '<tr><td>Subjects</td><td></td><td>List of Prequisites to be add</td><td></td><td>Pre-requisites</td></tr>';
while($row=mysql_fetch_array($result))
{
echo '<tr><td bgcolor="white">
<input type="text" readonly="readonly" size="16" name="subcode[]"
value="'.$row[sub_code].' "></td>

<td>
<select name="">
echo "<option value='".$row[sub_code]."'>".$row[sub_code]."</option>";
</select>
</td>

}

Lets assume that there are 10 subjects results
therefore there are 10 textboxes and 10 combo boxes

Every textbox has 1 subject result, my Problem is in the 10 combo boxes I want that there are also 10 subjects every combo boxes.

Fumigator
08-23-2006, 05:06 AM
So build your combo boxes after you've built your $row array from your database. You'll need to add an additional dimension to the $row array so you save every row you fetch.

Also using $row[sub_code] is bad practice; you really need to enclose the index name in quotes.

Spookster
08-23-2006, 05:33 AM
I badly neede answers

And I badly neede you to read our posting guidelines (http://www.codingforums.com/postguide.htm) and rules (http://www.codingforums.com/rules.htm).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum