Requesting data of 2 tables I want to let users 'mark' tickets for later use. 

So I created a table 'marked'. 

All tickets are located in the table 'ticketdata'. 

I have the following query to request all tickets for the logged in account:

$select = mysql_query("SELECT * FROM ticketdata WHERE member_id IN (SELECT member_id FROM users WHERE id=".mysql_real_escape_string($_SESSION['id']).") AND status &lt;='3'");


This is working fine. 

Now I want to let users 'mark' a ticket.

What I have done is create a mysql table (marked) with the following columns:

id, member_id, ticketid, active. 


So now is the question how to execute both queries in order to get the 'marked' tickets. I tried the following query:

EDIT: this is returning ALL results of the specific member_id in ticketdata, but I only need tickets that are listed in tbl 'marked'. 

$select = mysql_query("select a.title, a.discription, a.supportername, a.reportername, a.member_id FROM ticketdata a, marked b WHERE a.member_id IN (SELECT member_id FROM users WHERE id=".mysql_real_escape_string($_SESSION['id']).") AND b.active ='1'");


Unfortunatly with my basic mysql knowledge I am unable to get this query working.

Is there someone who can help me out ?

Thank you in advance.
Try this query, I've reformatted it to make it easier to read.  You really should specify the type of join (INNER, LEFT OUTER, etc.) and specify how they are related.  

SELECT a.title
    ,a.discription
    ,a.supportername
    ,a.reportername
    ,a.member_id
FROM ticketdata a
    INNER JOIN marked b ON b.ticketid = a.ticketid 
    INNER JOIN users u on u.member_id = a.member_id
WHERE u.id = ".mysql_real_escape_string($_SESSION['id'])."
    AND b.active = '1'