Gossamer Forum
Home : Products : Gossamer Links : Discussions :

unsubscribe imported from Links 2.0

Quote Reply
unsubscribe imported from Links 2.0
Hi,
I have a field imported from Links 2.0 named 'newsletter' 'Yes or No'
that I want to translate to Glinks.

I tried to run this query in phpmyadmin but it doesn't work.

DELETE FROM lsql_NewsletterSubscription WHERE (UserID) = (SELECT Email FROM `lsql_Users` where`Newsletter` like 'No')


I'm a little afraid to mess up.
Any clues ?


Thank you.
<br>
::::::::::::::::::::::::::::::::::::::::::::::::::::::
http://www.rando.net/eng, the french trekking directory
Quote Reply
Re: [mimilamite] unsubscribe imported from Links 2.0 In reply to
Its probably easier/cleaner to just make a new global:

update_newsletter_vals
Code:
sub {
my $sth = $DB->table("Users")->select( ['Username'], { Newsletter => "No" } );
while (my $email = $sth->fetchrow) {
$DB->table("NewsletterSubscription")->delete( { UserID => $email } );
}
}

Then make a new template called update_newsletter_vals_do.html , with the following in it:

Code:
<%update_newsletter_vals%>

Then simply run this from your browser to run the SQL queries:

page.cgi?p=update_newsletter_vals

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] unsubscribe imported from Links 2.0 In reply to
Worked great. Lots of thanks.
<br>
::::::::::::::::::::::::::::::::::::::::::::::::::::::
http://www.rando.net/eng, the french trekking directory