God! where do I start, I'm not great with MYSQL/PHP, if I don't make sense, sorry in advance. My problem is this.
I have a url paramater (a news article number - unique) that I have passed as $recordID in my PHP file.
I am doing a select on TABLE1 to select all records that are equal to this $recordID via a column called 'ArticleID'
(SELECT * FROM categories WHERE ArticleID ='$recordID')
this works ok.
This will bring out aproximately three rows from two columns 'ArticleID' and 'CategoryID'.
ArticleID
123
123
123
CategoryID
34546
54555
44567
Right, this is where i have no idea what to do, I now want to take the three rows from the column 'CategoryID' somehow store them and query TABLE1 and another table TABLE2 using a join.
The other table TABLE2 has a column called ArticleID that has the unique number that the $recordID was pulled from.
So what I want to do is select * from TABLE2.ArticleID where it it is equal to TABLE1.ArticleID only where that row in TABLE1 contains one of the 3 categoryID numbers pulled out in the original query.
Any IDEAS how to go about this?
SORRY, I know this is a long posting but I am lost and my neighbours dog has been howling all night and I can't concentrate, I may have to take the dog out if I can't get this sorted.
Thanks
I have a url paramater (a news article number - unique) that I have passed as $recordID in my PHP file.
I am doing a select on TABLE1 to select all records that are equal to this $recordID via a column called 'ArticleID'
(SELECT * FROM categories WHERE ArticleID ='$recordID')
this works ok.
This will bring out aproximately three rows from two columns 'ArticleID' and 'CategoryID'.
ArticleID
123
123
123
CategoryID
34546
54555
44567
Right, this is where i have no idea what to do, I now want to take the three rows from the column 'CategoryID' somehow store them and query TABLE1 and another table TABLE2 using a join.
The other table TABLE2 has a column called ArticleID that has the unique number that the $recordID was pulled from.
So what I want to do is select * from TABLE2.ArticleID where it it is equal to TABLE1.ArticleID only where that row in TABLE1 contains one of the 3 categoryID numbers pulled out in the original query.
Any IDEAS how to go about this?
SORRY, I know this is a long posting but I am lost and my neighbours dog has been howling all night and I can't concentrate, I may have to take the dog out if I can't get this sorted.
Thanks