0
public static function getPressRelease()
{
$res = Db::getInstance()->executeS('
        SELECT az.id_album, az.type, az.description, az.id_custom_pages, as.id_image, as.id_album , as.youtube, cp.custom_page_type, cp.title_custom_page
            FROM `'._DB_PREFIX_.'azgallery_album` AS az
            LEFT JOIN `'._DB_PREFIX_.'azgallery` AS ag
            LEFT JOIN `'._DB_PREFIX_.'custom_pages` AS cp WHERE cp.custom_page_type = 'gallery''); 
            return $res;
}

This line is throwing me error Parse error: syntax error, unexpected T_STRING in process.php on line 121

Zmax Gera
  • 55
  • 4

2 Answers2

0

Your last line is using ' for the gallery string and it breaks your whole SQL string. Try the following:

public static function getPressRelease()
{
$res = Db::getInstance()->executeS('
        SELECT az.id_album, az.type, az.description, az.id_custom_pages, as.id_image, as.id_album , as.youtube, cp.custom_page_type, cp.title_custom_page
            FROM `'._DB_PREFIX_.'azgallery_album` AS az
            LEFT JOIN `'._DB_PREFIX_.'azgallery` AS ag
            LEFT JOIN `'._DB_PREFIX_.'custom_pages` AS cp WHERE cp.custom_page_type = "gallery"'); 
            return $res;
}
Matt
  • 2,851
  • 1
  • 13
  • 27
0

You have twisted single quotes.

Use double quotes for last segment of the query like this:

public static function getPressRelease()
{
$res = Db::getInstance()->executeS('
        SELECT az.id_album, az.type, az.description, az.id_custom_pages, as.id_image, as.id_album , as.youtube, cp.custom_page_type, cp.title_custom_page
            FROM `'._DB_PREFIX_.'azgallery_album` AS az
            LEFT JOIN `'._DB_PREFIX_.'azgallery` AS ag
            LEFT JOIN `'._DB_PREFIX_.'custom_pages` AS cp WHERE cp.custom_page_type = ' . "'gallery'"); 
            return $res;
}
Pupil
  • 23,834
  • 6
  • 44
  • 66