• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

urgent please help me

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic