ShaneV Posted June 8, 2009 Report Share Posted June 8, 2009 Hi, I use a thanks mod on my board and i want to make a page where u can find a history of topics where a users had used thanks button. there is a row 'thanks_post' in ibf_posts where all user id's can be found that used the button like this: 16,58,56,48,584 This is not working with sql query appears if (in_array($randomValue, $sqlResult)) Found this on another board but don't know how to use it in a IPB based query. SELECT *, id IN (SELECT id FROM table WHERE {blabla}) FROM table Or SELECT *, id IN (1,5,20,64) FROM table Can somebody help? Thanks Greetz Link to comment Share on other sites More sharing options...
Management Michael Posted June 9, 2009 Management Report Share Posted June 9, 2009 Hi, I use a thanks mod on my board and i want to make a page where u can find a history of topics where a users had used thanks button. there is a row 'thanks_post' in ibf_posts where all user id's can be found that used the button like this: 16,58,56,48,584 This is not working with sql query appears if (in_array($randomValue, $sqlResult)) Found this on another board but don't know how to use it in a IPB based query. SELECT *, id IN (SELECT id FROM table WHERE {blabla}) FROM table Or SELECT *, id IN (1,5,20,64) FROM table Can somebody help? Thanks Greetz Try something like this. $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'topics', 'where' => "thanks_post IN(1,5,20,64)" ) ); $this->ipsclass->DB->simple_exec(); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.