Jump to content

[SOLVED] MySQL Boolean Logic - Ultra Newbie


sennetta

Recommended Posts

Trying to query the following table:

 

CREATE TABLE `gigs` (
  `id` int(6) NOT NULL auto_increment,
  `postdate` int(30) NOT NULL default '0',
  `gigdate` bigint(20) NOT NULL,
  `location` text NOT NULL,
  `price` varchar(20) NOT NULL,
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `postdate` (`postdate`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

 

with the following query:

 

SELECT * FROM gigs WHERE deleted=0 AND id>-1 AND (id=(1 OR 1 OR 1 OR 6 OR 6 OR 6 OR 6 OR 6 OR 6 OR 2 OR 2)) ORDER BY gigdate 

 

and it's only returning the first result it finds when it should return three results: those with unique IDs 1,2, and 6.  What's going on?

 

Cheers,

 

Anthony

Link to comment
https://forums.phpfreaks.com/topic/86000-solved-mysql-boolean-logic-ultra-newbie/
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.