Hello,
I see a couple of things that are causing your problem. First of all you are only selecting fields from the child table to be displayed so the join servves no purpose. Try adding a field from the partent table to the output and get the first join providing the results you want then use the HAVING post selection condition to just select the records that meet the second condition:
$getquery = mysql_query("select child.id as child_ID,
child.`name`, parent.id as parent_ID, child.position,
child.start, child.pending
from `mytable` child inner join `mytable` parent
on parent.id=child.parentid
where child.start='1' ORDER BY child.id DESC
HAVING pending=1");
Or something along those lines should work.
rch1231
Veteran Poster
1,040 posts since Sep 2009
Reputation Points: 142
Solved Threads: 154
Skill Endorsements: 12