My problem is found here in my loop that displays the results from my SQL query in my java into HTML
I need to add an "add to cart" link with <a href='?id=id&name=name etc.> But the problem lies in that one of the results the name has a possesive as in "John's Smith".
This single quotation mark is ending my href link and not adding that into the name section of the link.
Any suggestions?
do {
out.println("<tr><td class='col-md-1'> <a href='addcart.jsp?id="+rst.getString(1)+"&name="+rst.getString(2)+"&price="+rst.getString(4)+"'>Add to cart</a></td><td>"+rst.getString(2)+"</td><td>"+rst.getString(3)+"</td><td>"+rst.getString(4)+"</td></tr>");
} while (rst.next());
Thanks in advance!