Webmastersite.net
Register Log In

I want to get rid of most of my links
What is the easiest and quickest way of doing this

Comments on I want to get rid of most of my links

capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted Feb 14, 2007 - 7:02 AM:

I have about 16,000 links in my directory. I want to get rid of most of them except for 1 category and her subcats. What is the easiest and quickest way of doing this?

Many thanks
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 15, 2007 - 1:08 AM:

I think this query will work, but it's your risk:
DELETE FROM wsnlinks_links WHERE catid != x AND parentids NOT LIKE '%|x|%';
where x is the category id.
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted Feb 21, 2007 - 2:45 AM:

nah didn't work... this is what I got from PhPMyAdmin:

Deleted rows: 0 (Query took 0.0118 sec)
SQL-query :
DELETE FROM wsnlinks_links WHERE catid != 1 AND parentids NOT LIKE '%|1|%'


nothing was actually deleted - is there another way? Maybe manually dropping top-level tables through PhPMyAdmin....I have no idea whether possible or not though - would prefer to run a query.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 21, 2007 - 6:13 AM:

Maybe you use a different tables prefix.
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted Feb 21, 2007 - 6:52 AM:

nope - its in its own database, I have no need to use anything but the defaults...
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 23, 2007 - 8:57 AM:

Well can you use the search page in phpmyadmin to do a search for those links? That should involve using the LIKE %...% condition with |1| for the parentids field and 1 for the catid field. Once you can search them, can you then change it to 'not' to find what isn't them?
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted Feb 23, 2007 - 3:45 PM:

well guess what, the original query you gave me works after all... what I discovered, in a rounabout way, was that I decided to upgrade to the latest PhpMyAdmin (I was on a very old version) - and I ran the query after upgrading and it works very smoothly smiling face

Thanks!
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.