Aetherdan Posted March 15, 2018 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));
Aetherdan Posted March 15, 2018 Author Posted March 15, 2018 Resolved: $row = \IPS\Db::i()->select('coin_id', 'trader_holdings', array('member_id=? && period=?', $member_id, $period));
Midnight Modding Posted March 15, 2018 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.