how to get the tumbnails images for the product grid list

Hi friends

I’m trying to list some product in the front page grid and i have search for how to get the thumbnails pictures and how to the the pictures that are really in the thumbnail path, in a sql query,
i need a help, if i can have an example on SQL query that can fetch only a product that has the main images in the thumbnail, so that i will know the tables that are needed for this
thanks for helping

Did you upload thumbnails for the products manually? Usually they are automatically generated from the detailed images “on the fly”


Full image path is not stored in the database.

You can designate additional image from the main one for the product, by the value stored in the type column in the cscart_images_links table. It is either the [A]dditional or the [M]ain type.

The image’s file name is stored in the image_path column of the cscart_images table. For the products, these tables can be joined using the following statement:
cscart_images.image_id = cscart_images_links.detailed_id
Product ID is specified in the object_id column (** cscart_images_links**) where the object_type equals product.