How about in Upload DB, where Img, file name n etc are there, May be we can add a field PRODUCTNO, which stores a productID & that product no must be compared with productID from PRODUCT DB & then that product must be added when ADDTOCART is clicked.. Hope your able to understand.