Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-02-03 Thread Chris Bruce
HI John, I have this working with the exception of when there is a ' in an email address that I want to remove. I have modified your line { $email_list .= '{$row['email']}',; }, with { $email_list .= str_replace(', \', '{$r[email]}',); }, but now it escapes all the single quotes. Is there a

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-02-03 Thread John W. Holmes
From: Chris Bruce Is there a php function that escapes single quotes in Mysql queries? addslashes() mysql_escape_string() mysql_real_escape_string() ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-02-03 Thread Jason Wong
On Wednesday 04 February 2004 00:09, Chris Bruce wrote: I have modified your line { $email_list .= '{$row['email']}',; }, with { $email_list .= str_replace(', \', '{$r[email]}',); }, but now it escapes all the single quotes. Is there a php function that escapes single quotes in Mysql queries?

[PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Chris Bruce
Hello everyone, I am trying to write a function that would compare one table to a number of other tables in Mysql and remove any duplicates found. This is for tables of email addresses where I want to remove any dups found. Example: Master list - compare to list1, list2, list3, and so on and

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Raditha Dissanayake
Hi, If you are using mysql 4 you can use subselects to delete from where in (select) the select itself can be a multi table join. if you are on mysql 3.xx you can use PHP to mimic a subselect. Chris Bruce wrote: Hello everyone, I am trying to write a function that would compare one table

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Chris Bruce
Mysql 3.23.54. My first thought was to load the output from the tables into an array and they use a foreach and in_array to create a list of dups, but I wanted to see if there was an easier way. -- Chris Bruce [EMAIL PROTECTED] Idextrus E-Business Architects http://www.idextrus.com 3282

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread John W. Holmes
From: Chris Bruce [EMAIL PROTECTED] I am trying to write a function that would compare one table to a number of other tables in Mysql and remove any duplicates found. This is for tables of email addresses where I want to remove any dups found. Example: Master list - compare to list1, list2,

RE: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Mike Brum
My first thought was to load the output from the tables into an array and they use a foreach and in_array to create a list of dups, but I wanted to see if there was an easier way. -- If you're not using MySQL 4, then yeah, that's probably the best way. Just realize that this isn't going to be

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread John W. Holmes
From: Chris Bruce [EMAIL PROTECTED] Mysql 3.23.54. My first thought was to load the output from the tables into an array and they use a foreach and in_array to create a list of dups, but I wanted to see if there was an easier way. Ah, in that case, my other query won't work. :) This

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Chris Bruce
This will work for Mysql 3.23.54? -- Chris Bruce [EMAIL PROTECTED] Idextrus E-Business Architects http://www.idextrus.com 3282 Wilmar Cres. Mississauga, ON L5L4B2 CA 905.828.9189 On Jan 30, 2004, at 12:48 PM, John W. Holmes wrote: From: Chris Bruce [EMAIL PROTECTED] I am trying to write a

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Chris Bruce
Cool, thanks John, I'll give it a shot. Sorry for the last email, I sent it before you sent this one :) -- Chris Bruce [EMAIL PROTECTED] Idextrus E-Business Architects http://www.idextrus.com 3282 Wilmar Cres. Mississauga, ON L5L4B2 CA 905.828.9189 On Jan 30, 2004, at 12:54 PM, John W. Holmes

Re: [PHP] Comparing multiple Mysql tables to find duplicates

2004-01-30 Thread Raditha Dissanayake
Did you mention cofee John? now why did i suggest subselects when good old joins seem to do the tricks. Yikes! John W. Holmes wrote: From: Chris Bruce [EMAIL PROTECTED] I am trying to write a function that would compare one table to a number of other tables in Mysql and remove any