The query is wrong. You are selecting from multiple tables.. but not telling it what to look for in what table.
FROM ".$prefix."owned_adoptables AS a JOIN
PHP Code:
SELECT *
FROM adopts_adoptables AS a JOIN adopts_owned_adoptables AS b ON a.aid=b.aid
JOIN adopts_levels AS c ON a.aid=c.aid
WHERE `a.aid` = 144 AND
`a.type` = `adopts_adoptables`.`type` AND
(`adopts_levels`.`adoptiename` = `adopts_adoptables`.`type` OR
`adopts_owned_adoptables`.`currentlevel` = 0) AND
(`adopts_owned_adoptables`.`currentlevel` = `adopts_levels`.`thisislevel`
OR `adopts_owned_adoptables`.`currentlevel` = 0)
LIMIT 1
This isn't fully complete.. but you can see my changes & work with the pattern on what the WHERE is.
Sea