Data at Your Fingertips: Explore Our New Reporting and Statistical Capabilities By Ryan Ashbrook Tuesday at 01:29 PM
Aetherdan Posted March 15, 2018 Share Posted March 15, 2018 I cant seem to work out how to query the db using two params, there's not really any documentation that I can find and I don't know how to read through the source code to check. Anyway I want to do the following query: SELECT columnname FROM `tablename` WHERE member_id = 1 AND somethingelse = 2 I have tried the following with no luck: $row = \IPS\Db::i()->select('coin_id', 'trader_holdings', array('member_id=?', $member_id, 'period=?', $period)); Link to comment Share on other sites More sharing options...
Aetherdan Posted March 15, 2018 Author Share Posted March 15, 2018 Resolved: $row = \IPS\Db::i()->select('coin_id', 'trader_holdings', array('member_id=? && period=?', $member_id, $period)); Link to comment Share on other sites More sharing options...
Midnight Modding Posted March 15, 2018 Share Posted March 15, 2018 like above is how I do it, or i think you can technically do it the following way, also: $row = \IPS\Db::i()->select('coin_id', 'trader_holdings', array( array('member_id=?', $member_id ), array( 'period=?', $period ) ) ); edit: oops, I didn't realize you were the one who answered your own question. lol. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.