1 2 3 4 5 6 7 8 9 10 11 12
| function loadSitemapCatalog(){
global $connStr,$user,$pass;
$dbh = new PDO($connStr, $user, $pass);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare("SELECT * FROM (SELECT cat_id AS id, cat_libelle AS libelle, 0 AS cat_type, cat_id AS identifiant FROM db_plugins_catalog_cat UNION SELECT cat_id AS id, sub_cat_libelle AS libelle, 1 AS cat_type, sub_cat_id AS identifiant FROM db_plugins_catalog_subcat) AS matable ORDER BY id, cat_type");
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$stmt->execute();
$result = $stmt->fetchAll();
$stmt->closeCursor();
$stmt = null;
return $result;
} |
Partager