Checkbox Attribute as Criteria

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Checkbox Attribute as Criteria

Postby nymisoa » 7:53pm, Wed 25 Apr, 2007

I have a series of checkbox attributes which I use to send messages to the appropriate subset of my member list. Works great when the criteria is to send the message to members with a certain attribute with a checked status.

However, if I use a criteria for an attribute that's specifically unchecked, the sql query that's built doesn't work properly. It should query the attribute ID (9 in this example) I'm looking for with a value that's not null but it builds this query which looks like it should work but doesn't:
Code: Select all
   select table1.userid from phplist_user_user_attribute as table1 where table1.attributeid = 9 and ( table1.value = "" or table1.value = "0" or table1.value = "off")
Odd.
nymisoa
PL Nut
 
Posts: 28
Joined: 2:39pm, Thu 07 Dec, 2006

Fixed!!

Postby nymisoa » 12:04pm, Thu 26 Apr, 2007

Resolved. I had a problem with a bunch of NULL values in the attribute table I was selecting by. I changed the values to "off" so it should work next time. Thanks to the UPDATE query, it took all of a minute to write the query, execute and verify.
nymisoa
PL Nut
 
Posts: 28
Joined: 2:39pm, Thu 07 Dec, 2006


Return to Question & Problems - after installing

Who is online

Users browsing this forum: No registered users and 3 guests