mysql - Geting the first line in the textarea from database -
mysql - Geting the first line in the textarea from database -
i trying retrieve value of html textarea in jsp page mysql database.the problem having can first line in textarea(when i'm saving address in databse, it's retrieving first line only). happening text box also, info has space in database, it's getting first line of data. in advance.
html code:
<div class="container2"> <table> <tr> <td align="right">tpo name</td> <td><input type="text" readonly name="tponame" value=<%=rs.getstring("tponame")%>></td> </tr> <tr> <td align="right">name of college</td> <td><input type="text" readonly name="college_name" value=<%=rs.getstring("college_name")%>></td> </tr> <tr> <td align="right">contact number</td> <td><input type="text" name="contactno" value=<%=rs.getstring("contactno")%>></td> </tr> <tr> <td align="right">contact email</td> <td><input type="text" name="contactemail" value=<%=rs.getstring("contactemail")%>></td> </tr> <tr> <td align="right">address</td> <td><input type="text" name="address" value=<%=rs.getstring("address")%>></td> </tr> <tr> <td colspan="2"><input type="submit" class="button" value="update" style="float:right;"></input></td> </tr> jsp code:
<% class.forname("com.mysql.jdbc.driver").newinstance(); connection con=drivermanager.getconnection("jdbc:mysql://localhost:3306/fms","root","root"); statement st=con.createstatement(); string tponame= request.getparameter("tponame"); string college_name=request.getparameter("college_name"); string contactno=request.getparameter("contactno"); string contactemail=request.getparameter("contactemail"); string address=request.getparameter("address"); string sql = ("update tpo_details set contactno='"+contactno+"',contactemail='"+contactemail+"',address='"+address+"' tponame='"+tponame+"'"); st.executeupdate(sql); response.sendredirect("update_tpo_network_data.jsp"); %> mysql jsp
Comments
Post a Comment