Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Mysql Update, UPDATE multiple tables
post Feb 3 2004, 03:50 AM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 2
Joined: 23-December 03
From: Redondo Beach, CA
Member No.: 2,006

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.


Go to the top of the page
+Quote Post
post Feb 3 2004, 07:14 AM
Post #2

Its GNU/

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151

You will need variable1 and variable2 passed in (probably from a from), I will assume that variable1 is the description and variable2 is the model ... the sql statement will look like this:

update Table_2 set Table_2.products_description = variable1 where Table_2.products_id = Table_1.products_id and Table_1.products_model = variable2;

(the above is all one line)

Johnny Hughes
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 23rd March 2018 - 06:19 AM