Hi,

Im not sure wheter this is a bug ( and it will make me look silly ) but its 
been annoying :)..
It could even have been fixed since 3.22.27 :) ( Yes! I will upgrade 
tomorrow :)
I have these three tables:
***RULES***
CREATE TABLE rules
(id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
owner int(10),
name blob,
comment blob,
allow bit,
allusers bit,
allcds bit,
date_entered DATETIME);
***

***RULEMEMBERS***
CREATE TABLE rulemembers
(id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
ruleid int(10),
userid int(10),
date_entered DATETIME);
***
insert into rulemembers (ruleid,userid) values(0,0);

***RULEITEMS***
CREATE TABLE ruleitems
(id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
ruleid int(10),
itemid int(10),
date_entered DATETIME);
***

And they are sloppy done, I know.

As you probably understand they are linked togheter.. When I select data 
from rules I link with ruleitems and rulemembers.
My SQL is looking like this (for example):

select rules.id as ruleid from rules, rulemembers, ruleitems where 
rules.owner = 1 and rules.allow and ((rulemembers.ruleid = rules.id and 
rulemembers.userid = 1) OR rules.allusers) and ((ruleitems.ruleid = 
rules.id and ruleitems.itemid = 100) OR rules.allcds)

If there isnt some obvious errors in my SQL there is something wrong with 
MySQL because when I DONT have any posts in ruleitems or rulemembers this 
statement always returns zero.

(Even if rules.allcds och rules.allusers is set).

Very annoying.

Well, shouts to the mysqlteam for a great product .. heh. and sorry if ive 
been bothering you about this if there isnt any problems.


cheers.

--Hjalmar


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to