Gossamer Forum
Home : General : Databases and SQL :

Probably a stupid syntax error :(

Quote Reply
Probably a stupid syntax error :(
Hi,

Can anyone tell me why this won't work? :/

SELECT lsql_Links.* FROM lsql_CatLinks,lsql_Links WHERE 'lsql_CatLinks.CategoryID' = "867"

Basically, I need to grab the lsql_Links.LinkID from lsql_CatLinks, and then based on that.. .also grab the values from lsql_Links.ID, based on the values collected.

I could just do it like;

SELECT * FROM lsql_CatLinks WHERE CategoryID = 867;
...push these ID's into an array.
Loop through the array, and grab hashref.

Can anyone give me a pointer? Its got me going round and round in circles at the moment :(

TIA

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] Probably a stupid syntax error :( In reply to
Don't you need something in your WHERE clause joining these two tables: lsql_CatLinks,lsql_Links ?

~Charlie
Quote Reply
Re: [Chaz] Probably a stupid syntax error :( In reply to
AND lsql_Links.ID=lsql_CatLinks.LinkID for the join?

Smile

Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================

Last edited by:

HyperTherm: Mar 25, 2005, 11:08 AM
Quote Reply
Re: [HyperTherm] Probably a stupid syntax error :( In reply to
I don't have Links SQL so I'm not sure on the table/column names. But as long as that is the relation, it should fix the query.

~Charlie
Quote Reply
Re: [Chaz] Probably a stupid syntax error :( In reply to
I think he'd also need to remove the single quotes around the table/column name.