MySQL Forums
Forum List  »  Spanish

Registros de varias tablas
Posted by: Diego Linayo
Date: February 08, 2008 07:52PM

Hola me llamo diego tengo la sigueintes estructuras de tablas:


+-----------------------------mnid_photo---------------------+
id | date | filename | filesize | type | post_id | img_size |
+-----------------------------------------------------------+

y

+-----------------------------mnid_post ---------------------------+
id | date | tag_id | title | body | url | has_photo | has_comments |
+------------------------------------------------------------------+

y necesito conseguir lo siguiente:

seleccionar toda la data que haya en mnid_post y todas las imagenes que haya en mnid_post cuando mnid_post.post_id sea el mismo que este buscando en mnid_post.id;


+-----------------------------mnid_photo---------------------+
id | date | filename | filesize | type | post_id | img_size |
+-----------------------------------------------------------+


osea algo asi:

+-----------------------------mnid_post ---------------------------++-----------------------------mnid_photo---------------------+
id | date | tag_id | title | body | url | has_photo | has_comments | id | date | fo| filesize | type | post_id | img_size |
+-----------------------------mnid_post ---------------------------++-----------------------------mnid_photo---------------------+
blabla| blabla | blabla | blabla | blabla | blabla | 1 | has_comments | 1 | 2008-02-02 18:13:40| foto1 | 500 | jpg | 1 | 500 |
null| null | null | null | null | null | 1 | has_comments | 1 | 2008-02-02 13:13:40| foto2 | 600 | gif | 1 | 500 |
null| null | null | null | null | null | 1 | has_comments | 1 | 2008-02-02 20:13:40| foto3 | 700 | png| 1 | 500 |
+------------------------------------------------------------------++-----------------------------------------------------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
Registros de varias tablas
2577
February 08, 2008 07:52PM
3100
February 11, 2008 03:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.