Page 1 of 1

UPDATING Multiple tables

Posted: Thu Mar 16, 2006 9:14 am
by kendall
Hello,

I have the following SQL statement that updates 2 tables

Code: Select all

UPDATE contacts, accommodations SET name = %s, address = %s, locale = %s, country = %s, region = %s, tel = %s, fax = %s, email = %s, www = %s, summary = %s, rooms = %s, price_range = %s, amenities = %s, services = %s, tttic = %s, accommodations.category = %s WHERE ACCID = index_no AND index_no = %s

*note the %s denotes placeholder for information
my question is...if there was information in one table that was changed and in another it remained the same would it return affected rows?

another question ...if there werent any records in contact but there is in the accomodations (or vice versa) wud the accomodations table still be updated and return affected rows?

Posted: Thu Mar 16, 2006 9:20 am
by feyd
try it, find out.

Posted: Thu Mar 16, 2006 9:24 am
by kendall
Aahh,

thanks feyd i knew i can count on you for help :P....what going on with you whats the situation with the other devnet2 :wink:

Posted: Thu Mar 16, 2006 9:44 am
by feyd
I'm heading back to school.

D2's basically stopped at this point. I still own the domain, but it's hosted on a server I don't own or control, so for the most part, I have no relation to it. I will likely transfer it to a server I do own at some point.