Originally posted by starchdoggy
Is there a way to delete a category with links in it? When I try to do so it just tells me can't delete category it has links in it. If there is a way around this it would be great.
well, depends on how brave you are. You can use phpmyadmin that is found in your host's control panel as part of the mysql section ( well, most of them use phpmyadmin ).
first, back up your database and know how to restore it.
first, you will need the category id. browse the idx_category table and notice the first three columns - caategory_id, parent_id and name.
then in the SQL box find any links in the category you are trying to delete. Using category_id = 4:
Code:
select * from idx_link where category_id = 4 or cat1=4 or cat2=4
if you have sub-categories you will need to search thru all the subcats of the parent and then search the parent.
if you don't want to delete the link, change the appropriate subcat, cat1 or cat2 for the link
the safe thing to do at this point is to go to your INDEXU admin control panel and delete the links.
do this for all subcats and the parent
************************ ************************* ************************
if you want to use SQL ( this is the dangerous part )
Code:
delete from idx_link where category_id = 4 or cat1=4 or cat2=4
do this for all subcats and the parent
use your INDEXU admin control panel and delete the category.
I haven't test this but the syntax is simple. just watch the typing.
One thing that you can do before running the delete command is something like the following:
Code:
update idx_link set category_id=99999 where category_id = 4 or cat1=4 or cat2=4
then run a select command to review those links to make sure they are the ones you want to delete
Code:
select * from idx_link where category_id = 99999
when you are satisfied
Code:
delete from idx_link where category_id = 99999
unless you have a lot of links, it is better to delete from the admin control panel.