Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SQL command format..

Quote Reply
SQL command format..
Hi

We have a field in the Links table called 'article', were we store full articles for dynamic view.. The links which are articles are stored in many categories and there are over 400 of them.

We want to transfer all those links to one category..

Is there an SQL command that will do that for us?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL command format.. In reply to
 
WARNING: Do a backup of your database first...in case the outcome isn't what you want!

You could try something like this;

UPDATE lsql_CatLinks SET CategoryID = CategoryIDYouWantThemToGoIn

Obviously replacing 'CategoryIDYouWantThemToGoIn' with the appropriate category name.

That would just assign all the links in your LSQL database, into one category.

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: [katabd] SQL command format.. In reply to
I should think you would want to just change those links which are articles. I think it would need to be something like this (but as Andy said - make sure you back up first)

UPDATE Links,CatLinks SET CategoryID='newid' WHERE Article <> ''

It may be IS NOT NULL rather than <> ''.
Post deleted by katabd In reply to
Quote Reply
Re: [afinlr] SQL command format.. In reply to
I have a question on a similar situation

Can someone tell me what the relationship is between the LinkID & CategoryID in the lsql_catlinks table and the lsql_links.

I have a ton of links that do not have a category assigned that I want to assign to a single category,

I guessing I can do this using and sql command but without understanding how the two tables link I can't figure it out.

Is it through the ID field in the lsql_links table??

thanks

Andre

CCUnet
my Christian web
Quote Reply
Re: [ccunet] SQL command format.. In reply to
Yes there is a foreign key relation between the ID field in the Links table and the LinkID field in the CatLinks table. If you run SQL commands through LinkSQL it joins these tables automatically but if you just run them through the SQL monitor you probably have to tell it how to join them - something like WHERE Links.ID=CatLinks.LinkID - so you would have to add this to the statement above.