Advertisement

06.16.2008 at 11:31AM PDT, ID: 23489171
[x]
Attachment Details

Need help with updating table from other table information

Asked by brihol44 in MySQL Server

Tags:

I'm needing help with updating an "Active" field from one table based off of the values of another table. I can't seem to figure this out with what I have so far. Would this be a if/else procedure. I haven't used if/else with MySQL but I'm thinking there is another way.

So if print_advertising or web_advertising or newsletter advertising have a 1 value update advertisers_link_copy table.

Thanks,

BStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
<cfquery name="updateProfile" datasource="#dns#">
        UPDATE advertisers_link_copy INNER JOIN advertisers_ad_list USING (advertiser_ID)
        SET advertisers_link_copy.active = '1'
        WHERE advertisers_ad_list.advertiser_id = advertisers_link_copy.advertiser_id
        OR advertisers_ad_list.print_advertising = '1'
        OR advertisers_ad_list.web_advertising = '1' 
        OR advertisers_ad_list.newsletter_advertising = '1'
    </cfquery>
[+][-]06.16.2008 at 11:37AM PDT, ID: 21796216

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL Server
Tags: MySQL
Sign Up Now!
Solution Provided By: virmaior
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.16.2008 at 12:01PM PDT, ID: 21796383

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 12:29PM PDT, ID: 21796639

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 01:03PM PDT, ID: 21796962

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 01:08PM PDT, ID: 21797018

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 01:27PM PDT, ID: 21797177

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628