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