I am new to SQLite and databases, so I am stil learning how to optimize their use...
I am working on a "shopping cart" type of feature, it is actually a favorites feature for a system that displays images in multiple galleries. There is a SQLite table that contains the user_id, gallery_id, and image_id. When a index page is displayed, only a sub set of the images in the gallery are displayed. So the question is what will be faster: 1: Doing a SELECT for each image on the favorites table to see if it is selected 2: Doing one SELECT to get all the images for the current gallery and store that into a PHP array and then simply look in the PHP for each image? My thought is option 2. Is that correct? Sam _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users