Re: [PHP-DB] Pulling an ID list from a DB, then filtering that list againstanother list of ID's
From: "Matt Babineau" <[EMAIL PROTECTED]> > Got an interesting problem! I have a list of ID's, basically things > people have viewed on my website. When I pull the viewable items from my > database, I need to be able to filter out all the ID's people have > already viewed, so that they only get a list of things they have not > viewed. > > I can think of a way to do this, but it is a nasty loop situation, that > would probably not be good and tie up significant CPU time. Anyone have > any suggestions on ways to filter view items from a fresh list that I am > pulling from my Database? So you have a "thing_id" and a "user_id". How do you mark the user as having viewed the "thing"? I'm thinking a LEFT JOIN is in order here, but need some more info on your table structure. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Pulling an ID list from a DB, then filtering that list againstanother list of ID's
Hey All- Got an interesting problem! I have a list of ID's, basically things people have viewed on my website. When I pull the viewable items from my database, I need to be able to filter out all the ID's people have already viewed, so that they only get a list of things they have not viewed. I can think of a way to do this, but it is a nasty loop situation, that would probably not be good and tie up significant CPU time. Anyone have any suggestions on ways to filter view items from a fresh list that I am pulling from my Database? RH9, PHP 4.3.2, MySQL 4.0.14-standard, Apache 2.0.47 Thanks! Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php