UPDATING Multiple tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

UPDATING Multiple tables

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

try it, find out.
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post 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:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply