Author Topic: How do I remove people from list?  (Read 2756 times)

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« on: June 24, 2005, 03:48:16 pm »
Hi

Can anyone tell me how to remove one list of people from another list.

Example:-

If I have list 1 and I have list 2, and the people in list 2 are also in list 1, how do I remove the list 2 people from list 1?.....There maybe about 800 people in list 2 and about 30000 people in list 1.

Thankyou...Paul

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How do I remove people from list?
« Reply #1 on: June 25, 2005, 03:05:05 am »
I would use a custom PHP script, but it might be possible with some advanced SQL.

e.g. (untested):

Code: [Select]

<?php// remove users on list y who exist on list x// example to purge list y users who exist on list x$listx = '2';$listy = '1';$pathtoLM = "./";include($pathtoLM.'config.php');include($pathtoLM.'admin.php');$xusers = mysql_query("select email from $utable where list = '$listx';");while(list($e)=mysql_fetch_row($xusers)){ $yuser = mysql_query("select id from $utable where list = '$listy' and email like '$e';"); if(@mysql_num_rows($yuser)>0){  list($yi)=mysql_fetch_row($yuser);  mysql_query("update $utable set cnf = '2' where id = '$yi';");  echo "removed $e from list $listy<br>";  flush(); }}?>



Copy the code into a new .PHP file, modify the list numbers at the top, upload the file to your ListMail folder and browse to it.

Let me know if it works. :)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« Reply #2 on: June 25, 2005, 04:36:40 am »
Hi Dean

Which folder is my Listmail folder, and how exactly do I browse to it?

Thanks...Paul

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How do I remove people from list?
« Reply #3 on: June 25, 2005, 09:06:28 am »
Connect via FTP. Your ListMail folder (under Plesk) is httpdocs/mail.  Copy the code into a new .PHP file (ie: customremove.php), upload it to that folder, and browse to it at http://yoursite.com/mail/customremove.php.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« Reply #4 on: June 25, 2005, 02:21:46 pm »
Thanks Dean....I will let you know how it goes.

Paul

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« Reply #5 on: June 25, 2005, 02:55:09 pm »
Hi Dean

I did it with this URL http://thedailyguru.com/mail/removeusers.php

But I get this error message:-

Parse error: parse error, unexpected T_VARIABLE in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 15

Please let me know what to do.

Thanks...Paul

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How do I remove people from list?
« Reply #6 on: June 25, 2005, 09:13:29 pm »
I have updated the original code - please try again.

Regards,
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« Reply #7 on: June 25, 2005, 10:38:44 pm »
Hi Dean

Now I am getting this error message:-


Warning: main(./global.php): failed to open stream: No such file or directory in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 11

Warning: main(): Failed opening './global.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 11

Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 13

Warning: mysql_query(): A link to the server could not be established in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 13

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/thedailyguru.com/httpdocs/mail/removeusers.php on line 14


Thanks....Paul

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
How do I remove people from list?
« Reply #8 on: June 26, 2005, 04:00:43 pm »
I've been working on too many sites lately..  I accidentally called ListMail's admin.php file, global.php.  Duh  :x

I have updated the original code and also modified it so that list ONE users are removed if they are found to exist on list TWO, instead of the other way around, which does not seem to be what you want. :)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

paulzaiter

  • Posts: 25
    • View Profile
How do I remove people from list?
« Reply #9 on: June 27, 2005, 01:03:38 am »
Thanks Dean...worked great!!!