JOIN between tables
<p>I have a little trouble with a query.</p>

<p>I have this DB structure</p>

<p>PROCESSES
process_id
process_name</p>

<p>ITENS
item_id
item_process_id
item_name</p>

<p>FILES
file_id
file_item_id
file_name</p>

<p>I run this query to obtain Process ID:</p>

<pre><code>$result = mysql_query("SELECT * FROM processes WHERE process_id='$process_id'");
$row = mysql_fetch_array($result, MYSQL_BOTH);
$process_id = $row['process_id'];
</code></pre>

<p>Put this ID in a LOOP to obtain all Itens from table:</p>

<pre><code>$query="SELECT * FROM itens WHERE item_process_id='$process_id'";
$result = mysql_query($query) or die(mysql_error());
$num = mysql_numrows($result);
</code></pre>

<p>And call Item name into a LOOP</p>

<p>Problem is when i try to call "file_name" from FILES table.
I have tried with a LEFT JOIN to table but with no success.
"file_name" variable is blank</p>

<p>Can anyone help me to understand how solve this?</p>

<p>TKS</p>
