•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 427,790 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,726 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 3837 | Replies: 15 | Solved
•
•
Join Date: Aug 2006
Posts: 15
Reputation:
Rep Power: 3
Solved Threads: 0
I'm brand new to SQL queries, hoping someone can help me set up this query.
I'm using phpList to manage my mailing list. All user defined attributes appear to be stored in a table called phplist_user_user_attribute. The structure of this table is:
attributeid 16 refers to a boolean field referred to in another table as "Targeted", which I want to use for mailing list selections.
what I need to do is find every record with attributeid of 7 and a value of "68104" (for example), as:
this gives me a list of all userid's in this zip code.
then, for every userid found, I need to set attribute 16 'ON', as
(the above code sets the flag 'ON' for userid 1, but I can't figure out how to do it for every userid found in the previous query. Can I 'nest' these somehow?
I'm guessing this is pretty simple, I just need some help...
Thanks,
~kyle
I'm using phpList to manage my mailing list. All user defined attributes appear to be stored in a table called phplist_user_user_attribute. The structure of this table is:
Field, Typeattributeid 7 represents zipcodes
attributeid, int(11)
userid, int(11)
value, varchar(255)
attributeid 16 refers to a boolean field referred to in another table as "Targeted", which I want to use for mailing list selections.
what I need to do is find every record with attributeid of 7 and a value of "68104" (for example), as:
SELECT * FROM `phplist_user_user_attribute` WHERE `attributeid`= 7 AND `value`= "68104"
this gives me a list of all userid's in this zip code.
then, for every userid found, I need to set attribute 16 'ON', as
UPDATE `phplist_user_user_attribute` SET `value` = '' WHERE `attributeid` =16 AND `userid` =1;
I'm guessing this is pretty simple, I just need some help...
Thanks,
~kyle
Last edited by kyleknapp : Oct 10th, 2006 at 4:10 pm.
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: How do I edit a file in MySql please?
- Next Thread: Image Database



Threaded Mode