Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-03-2004, 03:12 AM   #1
Registered: Dec 2003
Location: USA
Distribution: Debian
Posts: 40

Rep: Reputation: 15
UPDATE multiple mySQL tables

I know this is easy for most of you but I been googling all over the place for help on this.

I have two tables and a text file
In the text file I have

products_model, products_description

The Tables look like this:
Table_1: products_id, products_model, etc. etc.
Table_2: products_id, products_description, etc. etc.

How can I UPDATE products_description in Table_2 WHERE products_model in Table_1 matches to the text file products_model.
Old 02-03-2004, 07:41 AM   #2
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Er, I'm assuming these are linked by products_id, so:

UPDATE Table_2
SET products_description = <whatever>
WHERE Table_2.products_id = Table_1.products_id
      AND Table_1.products_module = "<value you get from text file>"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting and reusing existing mysql permissions/dbs/tables after update deesto *BSD 0 10-29-2005 03:46 PM
mysql reinstallation distorted by previous tables in /var/mysql mad4linux Linux - Software 0 10-04-2005 01:39 PM
API for using multiple routing tables on Linux Shakesh Linux - Networking 0 08-29-2005 05:45 PM
IP tables routing of multiple IP addresses 2buck56 Linux - Security 4 05-11-2005 05:06 PM
SQL: making queries from multiple tables ganninu Programming 1 01-08-2004 11:17 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration