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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
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