Inserting Records from a table into another table..
| From: | Rahul S. Johari | Date: | Thu, 22 May 2003 11:47:00 +0000 |
| Subject: | Inserting Records from a table into another table.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148538@lists.php.net to get a copy of this message | ||
Glory!
How can I take records from one table into another based on a criteria..
Let's say I have a table xyz with a field "username" & "user_id"
Another table abc with a field "name" and "id"
Table XYZ has many rows with "user_id" having records .. but "username"
being empty.
The name & id field in table abc are corresponding to each other ..
i.e., if user = "Rahul" and id = "26" .. then it will be the same for
xyz.
What I want to do is, pick up "name" from table abc and insert it into
"username" in table xyz .. based on its' ID..
Did I make sense?
PHPSpooky
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Every man has a right to fulfill his own Will without
being afraid that it may interfere with that of others;
for if he is in his proper path, it is the fault of
others if they interfere with him.
Do what thy wilt shall be the whole of the Law!
Love is the Law, Love under Will"
- Aleister Crowley, "Magick without Tears"
Rahul S. Johari
Shining Star Productions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~