2

I want to convert following sql query to zend query. How I can convert this mysql query into zend query with zend framework 2?

select * from user where BINARY username = "testUser";

Thanks

1

2 Answers 2

1

Did you tried this:

$select = $select->where('username' => new \Zend\Db\Sql\Expression("BINARY('testUser')"));
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks.Thanks a lot.Working successfully. :)
0

Here how you can write your query in Zend:

$select = $db->select()
             ->from('user')
             ->where('BINARY username = ?', "testUser");

1 Comment

Thanks. But this code it not working in zend framework 2 :( . This is ok with Zend framework 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.