im using php and ajax. Problem is that i want to search seat numbers bases of batch and semester condition on onchange event eg. if i search batch 2008 and semester first then in mysql db retrieve seat numbers 1,2,3,4 in text boxes problem in while loop why if write this so it is unsuccessful
while($row=mysql_fetch_array($result))
{
echo "<input name='seat' type='text' value=".$row['Seat_Number'].">";
}
error on this line Seat Numbers Warning: mysqlfetcharray(): supplied argument is not a valid MySQL result resource in E:\software\wamp\www\result_db\findseatno.php on line 23
but if i write this code with option menu it is successful
echo "<b> Seat Numbers</b>";
echo "<select name='seat'>
<option>Select seat numbers</option>";
while($row=mysql_fetch_array($result))
{
echo "<option value>".$row['Seat_Number']."</option>";
}
echo "</select>";
plz solve this problem if i search in text field so what i do?
entermarks.php
<div align="left"><strong>Batch</strong> :
<select name="batch" onChange="getSeat(this.value,this.value,this.value);getSeat(document.fm.degree.selectedIndex,document.fm.batch.selectedIndex,document.fm.semester.selectedIndex);">
<option value="">Select Batch</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
</select>
<br />
</div>
<div align="left"><strong>Semester</strong> :
<select name="semester" onChange="getSeat(this.value,this.value,this.value);getSeat(document.fm.degree.selectedIndex,document.fm.batch.selectedIndex,document.fm.semester.selectedIndex);">
<option value="">Select Semester</option>
<option value="first">first</option>
<option value="second">second</option>
</select>
<br />
</div>
<div id="seatdiv">
<div align="left"><strong>Seat Numbers</strong>
<input name="seat" type="text" id="seat"/ >
</div>
</div>