Answer the question
In order to leave comments, you need to log in
Getting data from the database using modx?
Good day, tell me how to remake getting data from a simple sql query to xpdo in a modx snippet
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/sql.php');
$sqll = "SELECT * FROM modx_gallery_tags,modx_gallery_items WHERE modx_gallery_tags.tag = '".$slim."' and modx_gallery_tags.item =modx_gallery_items.id " ;
$statementt = $modx->query($sqll);
$userss = $statementt->fetchAll(PDO::FETCH_ASSOC);
foreach ($userss as $user) {
$scr="/assets/gallery/".$user['filename'];
$name=$user['description'];
print'<div class="mosaicflow__item" style="float:left;padding:20px;"><a class="fancyimage" data-fancybox-group="group" title="'.$name.'" href="'.$scr.'"><img src="'.$scr.'" width="200" height="200" alt="'.$name.'" /></a></div>';
}.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question