Jump to content

select_query() where AND/OR


evotz

Recommended Posts

With the select_query() SQL helper, is the where array an AND or an OR?

 

select_query("table", "id, user", array("field1" => "variable1", "field2" => "variable2"));

 

Is this saying:

 

select `id`, `user` from `table` where `field1`="variable1" AND `field2`="variable2";

 

OR

 

select `id`, `user` from `table` where `field1`="variable1" OR `field2`="variable2";

Link to comment
Share on other sites

It's AND

 

select `id`, `user` from `table` where `field1`="variable1" AND `field2`="variable2";

 

I enabled MySQL query logging and ran a test. While AND is what I was wanting for this particular purpose, I'm not sure how you get an OR using select_query().

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated