Jump to content

conditional query...trouble getting results?


fivestringsurf

Recommended Posts

table: tutorial

| tut_id | con_id | med_id |

 

table: medium

| med_id | parent_id | medium |

 

table: content

| con_id | content |

 

I'm trying to return the [content] fields from the table: contentafter being given the value of [medium] from the table: medium.

 

*Notice a "medium" can be a parent value or a child value in that table. (this is causing a problem)

As a result I need away to figure out if [medium] is a parent or child...

...then trace it's value back to table:tutorial....

find all the con_id's there...link them up with the table:content...

and return all [content] values.

 

i know how it should work ( i think i explained it ok..?) and i think i wrote the db with referential fidelity :)

I've tried sub-queries, inner joins, grouping, and some realy ugly mixing of php and mysql.

I'm certain an expert here will have some advice for me.

 

I'm using mysql 5

i've attached a dump of the db

 

Thank you.

 

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.