php - how to convert this SQL statement for FluentPDO code -


i made sql statement use in project i'm working on , have used fluentpdo before has been while , have never used subquery in before, wondering if out there knows way this, know can join not familiar method , never seen used before don't know enough make work, i'm trying brush on can myself.

select *    users   username = 'admin'         , password = 'testing'         , company_id in (select company_id                              company                            subdomain = 'testing'); 

$result = $db->from('users')         ->innerjoin('company on users.company_id = company.company_id')         ->where('username', 'admin')         ->where('password', 'testing')         ->where('subdomain', 'localhost')     ->fetch(); 

i figured out answer, , wanted post wondering same way was.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -