Hi Everyone, I'm not entirely sure how images would work with php. The images these types of websites have (below) do you believe the images are stored in a mysql database and called like everything else or are they stored differently? If so, how are they called? http://www.lotpro.com/cars/new/porsche/boxster/ http://www.lotpro.com/search/vehicleinfo/02921/all/all/0/999999/0/999999/5YMGY0C52CLK27716/yy0115/ Thanks Everyone!
The best way is storing the images on your server and storing a link to the image in your MYSQL. For example I will store 3 images in a folder named "images". The name of each image is "image1.jpg", "image2.jpg" and "image3.jpg". /Images >image1.jpg >image2.jpg >image3.jpg The in the MYSQL database, I will store a link to the image using a varchar field for example +------------+-------------------+ | Image_ID | Image_Link | +------------+-------------------+ | 0001 | /image/image1.jpg | | 0002 | /image/image2.jpg | | 0003 | /image/image3.jpg | +---------------+-------------------+ And using php echo the Image_Link path in my html based on the page requested <?php $Image_Link = //the link you stored in the MYSQL database $image1 = '<img src="www.example.com'.$Image_Link.'" />'; ?> PHP:
It is possible to store images in mysql as binary but I doubt that's what they are doing. I would just do what HostPlantz suggested.
it would be better if you just store the name of the image in the database table instead of the whole path . cause if you ever in future change your image directory path, then you'll have to change everything in the database.. so a better code would be <?php $Image_name = //the name you stored in the MYSQL database $Image_path=//the path $image1 = '<img src="www.example.com/'.$Image_path."/".$Image_name.'" />'; ?>