Im a little puzzled here, can someone just look over this query and tell me am i doing anything wrong?
SELECT d.* FROM as_downloads d LEFT JOIN as_categories c ON (d.download_category_id = c.category_id) WHERE d.download_category_id != -1 LIMIT 30
Fetching the rows from the as_downloads
table but not joining the categories table..
Theres no error what so ever, Ive tested in PHPMyAdmin and same result, Here's the PHP Code used
class Model_Downloads extends ModelType_PDO
{
public function fetchDownloads($limit)
{
$p = Registry::get('Config')->Database->prefix;
$query = "SELECT d.* FROM ".$p."downloads d LEFT JOIN ".$p."categories c ON d.download_category_id = c.category_id WHERE d.download_category_id != -1 LIMIT :limit";
$this->query = $this->prepare($query);
$this->query->bindValue(':limit',$limit,PDO::PARAM_INT);
if($this->query->execute())
{
return $this->query->fetchAll(PDO::FETCH_CLASS);
}
return false;
}
}