• Post Reply Bookmark Topic Watch Topic
  • New Topic

urgent please help me

 
lp
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i have been writing a jsp page where i am exectuing a query and the o/p would be in a form of a drop menu box but i am not getting the o/p.when i execute the query at mysql prompt i am getting the o/p .please let me know what the problem is .i want the 3 values in one row .
ResultSet rs = stmt.executeQuery("select instructor_first_name,course_name,section_name_or_no from instructors_staff,section,course where course.course_no=section.course_no and section.instructor_id=instructors_staff.instructor_id;");
if(rs!=null)
{
while(rs.next())
{
String name = rs.getString("instructor_first_name");
String cname=rs.getString("course_name");
String sname=rs.getString("section_name_no");
%>
<option value =><%= name %><% = cname %><%= sname %></option>

<%
}/*end of while loop*/
}//if loop
</select></td>
</tr>

------------------
Thanks
Lakshmi
 
lp
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the ; is not there in the original program query which i have been running so this is not the problem,incase you point out that i wanted to let u all know
Thanks in advance
Lakshmi
 
Rex Rock
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of things I can see
1.<option value=>
You are closing the angle bracket.

2. Don't leave extra spaces when you write scriplets.
<%=name%> is how i would write it.
and next time, you might want to open up the html produced by "view source" to see whats happening behind the scenes, that will help you fix your bugs easily
RR
[ April 09, 2002: Message edited by: Rex Rock ]
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey
the syntax should not be
<option value=> <%=var%> </option>
it should be
<option value= <%var%> > </option>

variable should be inside the option tag
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!