RE: [PHP] Inserting Records from a table into another table..

From: Date: Tue, 31 Dec 2002 13:31:15 +0000
Subject: RE: [PHP] Inserting Records from a table into another table..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148542@lists.php.net to get a copy of this message
This seems to be more of an SQL query that you need to run, rather than solving it with PHP. What you could do is read the data from table abc and xyz, put them in two arrays and build a comparison based on the abc arrays and then set the value in the xyz-array. Do not forget to put the data later on back in the tables... Have fun ! -----Oorspronkelijk bericht----- Van: Rahul S. Johari [mailto:rahul.brenda@mjimm.com] Verzonden: Thursday, May 22, 2003 1:47 PM Aan: php-general@lists.php.net Onderwerp: [PHP] Inserting Records from a table into another table.. 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

« previous php.general (#148542) next »