I am developing an e-Commerce website for my academic project and I need to show products in my home page. I need to show all my products from the database. For my images of products I thought one simple way. I will store the paths for every image in the table of products in my database under, a column product_image.
Product_Id Product_Name Product_Description Product_Image Product_Price Product_Stock
1 HeadFirstJava Java Programming Language c:\products\headfirst.jpg 330 30
But when I am retrieving all the products information from database in my JSP page, I am not getting any images. I checked database the image paths are stored without backslashes.
What is the problem? How do I store those paths?
When you want to insert values with backslash using
PHP,C#and any other, be sure to escape it another backlash.if you try to insert this value, surely it will fail:
but this one is fine: