Re: Inserting Records from a table into another table..
| From: | Marek Kilimajer | Date: | Thu, 22 May 2003 12:28:19 +0000 |
| Subject: | Re: Inserting Records from a table into another table.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148541@lists.php.net to get a copy of this message | ||
This question belongs to a mailing list of your sql database. Still check manual for INSERT .... SELECT syntax
Rahul S. Johari wrote:
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~