|

November 2nd, 2006, 04:35 AM
|
|
Registered User
|
|
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Retrieve Info from Database
Hi,
I urgently need to solve my problem, I have this page edit_pd.asp which retrieve info from database. I have no problem except for nationality field. There is nothing display to the drop down box.
Quote:
quote:<%
set rs = server.createobject("adodb.recordset")
set tmprs = server.createobject("adodb.recordset")
if Request.QueryString("type") = "edit_pd" then
sql = "select * from student where student_id = " & Request.QueryString("student_id")
rs.open sql,strconnect,0,1
if not rs.eof then
reg_date = rs("reg_date")
stud_id = rs("stud_id")
fileno = rs("fileno")
name = rs("name")
cn_name = rs("cn_name")
passno = rs("passno")
************ = rs("************")
passissue = rs("passissue")
passexpiry = rs("passexpiry")
address = rs("address")
postcode = rs("postcode")
state = rs("state")
country_id = rs("country_id") dob = rs("dob")
hp_no = rs("hp_no")
email1 = rs("email1")
email2 = rs("email2")
end if
rs.close
end if
%>
<tr>
<td width="407">
* Nationality
<select name="country_id">
<option value="0"></option>
<%
sql= "select country_id, country_name from country order by country_name ASC"
rs.open sql, strconnect,0,1
while not rs.eof
if country_id = Clng(rs("country_id")) then
response.write "<option value=" & rs("country_id") & " selected>" & rs("country_name") & "</option>"
else
response.write "<option value=" & rs("country_id") & ">" & rs("country_name") & "</option>"
end if
rs.movenext
wend
rs.close
%>
</select>
</td>
<td colspan="2">Date of Birth (MM/DD/YYYY)
<input type="text" name="dob" value="<%=dob%>" class="txtbox" size="15" maxlength="15" onfocus="this.blur();">
<a href="javascript:void(null)" onClick="window.dateField = document.student.dob;
calendar = window.open('date.asp',null,'WIDTH=185,HEIGHT=203, status=no,toolbar=no,menubar=no,location=no,scroll bars=no,resizable=no,top=0,right=0')">
<img src="pic/calender.gif" border="0"></a> </td>
</tr>
|
|