Jump to content

[SOLVED] MySQL || Operator


centenial

Recommended Posts

Hi,

I have a MySQL || OR operator question. Here's my query:

SELECT
id, name
FROM
images
WHERE
userid = '1' AND
(field1a > 100) || (field1b > 100) AND
(field2a > .2) || (field2a > .2)

I want to select all records from the image table where userid = '1', where either field1a or field1b are greater than 100, and where field2a or field2b are greater than .2.

The query as it is pulls the records for all users from the database, not just the ones for user1. Help anyone?
Link to comment
https://forums.phpfreaks.com/topic/36380-solved-mysql-operator/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.