SQL Builder for PHP, with JOIN support?

后端 未结 10 2046
-上瘾入骨i
-上瘾入骨i 2020-12-19 15:29

Are any of you aware of a library that helps you build/manipulate SQL queries, that supports JOIN\'s?

It would give a lot of flexibility i\'d think if you have somet

10条回答
  •  一个人的身影
    2020-12-19 16:06

    superfast SQLObject based IteratorQuery from pastaPHP
    iterates over resource

     foreach(_from('users u')
       ->columns("up.email_address AS EmailAddress", "u.user_name AS u.UserName")
       ->left('userprofiles up', _eq('u.id', _var('up.id')))
       ->where(_and()->add(_eq('u.is_active',1)))
       ->limit(0,10)
       ->order("UserName")
       ->execute("myConnection") as $user){
    
       echo sprintf(
              '%s
    ', $user->EmailAdress, $user->UserName ); }

提交回复
热议问题