How to get the IDs of content parts within an article?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

How to get the IDs of content parts within an article?

Post by Cassiel »

Okay here's a question for you guys:

I have an article with ID 1 let's say. And within this article I have three content parts for example: 2, 3 and 4. Now here's what I want: I want to know how I can query the article with ID 1 to get the content part number 3. Anyone knows how to do it?

The whole id, a_id, u_id fields within the MySQL table are really tricky if you don't know the meaning. Maybe someone can tell me if not able to answer my question above.

Thanks in advance! :)

Regards,
Cassiel
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

this is very simple - but don't forget sorting. Based on this you can make a decision.

I think I know what you have in mind by asking this question.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Oliver Georgi wrote:this is very simple - but don't forget sorting. Based on this you can make a decision.

I think I know what you have in mind by asking this question.

Oliver
duh :?: :shock:
I'm lost here...
I get the question but the reply seems 'sherlock holmish'... :D
...
How simple is it? If u have some time to reply ;) thx

Cheers
User avatar
Oliver Georgi
Site Admin
Posts: 9918
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

check "content.article.inc.php". Sorry, I have no time to explain it here at the moment.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

Well thanks.. :roll:
Cassiel
Posts: 24
Joined: Tue 22. Jun 2004, 13:52
Location: Friedrichshafen, Germany
Contact:

Post by Cassiel »

Sorry but I didn't get it. :(
Please Oliver, give me a hint. Thanks!

Edit: Okay, think I got it.

Example:

Code: Select all

SELECT *
FROM phpwcms_article as article
INNER JOIN phpwcms_articlecontent as acontent
WHERE article.article_id = acontent.acontent_aid
AND article.article_id = X
*Note: X = Your 'article_id' from table 'phpwcms_article' you want to fetch
Post Reply