dadamssg Posted August 12, 2009 Share Posted August 12, 2009 i have an array ($topic_ids) that i want to combine with a simple query like this SELECT * FROM Topics WHERE topic_id = $topic_ids how do i got about doing this? Quote Link to comment https://forums.phpfreaks.com/topic/169872-query-based-on-an-array/ Share on other sites More sharing options...
trq Posted August 12, 2009 Share Posted August 12, 2009 This is a php question. $sql = "SELECT * FROM Topics WHERE topic_id IN('" . implode("','", $topic_ids) . "')"; Quote Link to comment https://forums.phpfreaks.com/topic/169872-query-based-on-an-array/#findComment-896219 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.