Re: comparing 2 mysql tables

From: Date: Fri, 24 Aug 2001 14:29:23 +0000
Subject: Re: comparing 2 mysql tables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64250@lists.php.net to get a copy of this message
I would use: $query = "select table.user from table LEFT JOIN table2 ON table.user=table2.user where table2.user is NULL"; This will return every member of user which is present in table but not in table2. From there you can do pretty much whatever you want with it in PHP Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com ----- Original Message ----- From: "Tom Churm" <thomas.churm@pixelpark.com> To: <php-general@lists.php.net> Sent: Friday, August 24, 2001 8:52 AM Subject: [PHP] comparing 2 mysql tables > hi, > > i've got 2 different MySQL tables. i need to check which entries in the > text-field 'User' in one table are NOT present in the 'User' field in > the other table. then i need to either save this array to a textfile or > otherwise prepare it for creating a new, third table. > > any hints on how this kind of comparison operation can be accomplished? > > many thanks, > > tom > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#64250) next »