Ciao!
I'm planning to upgrade my website with this database layout:
authors
------
id
first_name
etc
articles
--------
id
pub_date
etc
articles_en
-----------
id
title
content
etc
articles_it
-----------
id
title
content
etc
articles_authors
----------------
article_id
author_id
I'm using mysql but I have installed into the server postgres too.
To obtain an article I can do
SELECT * FROM articles, articles_$lang WHERE articles.id = $id AND articles_$lang.id = $id
To obtain the authors list I can do
SELECT * FROM authors, articles_authors WHERE author_id = authors.id AND article_id = $id
ehm, ehm I did not test them...
I ask if it is possible to merge those two queries.
Practically I want to obtain the article data and all the authors of that article with a single query.
Is that possible ?
Has a DB design sense what I'm asking for ?
As I said previously I could use postregs too,
but actually I would prefer mysql.
I'm using php.
Thank you in advance...![]()






Bookmarks