Jump to content

Query DB with two params?


Aetherdan

Recommended Posts

Posted

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));

 

Posted

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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...