Answer the question
In order to leave comments, you need to log in
How to work with this data obtained from the DB table?
Good day. In MODX, using a self-made snippet, I get data from a table in the database.
Purpose: to display data in the form of a list on the site. In php and sql, a complete zero, and in Google, I clearly formulate the task incorrectly.
Here is the snippet code:
<?php
$sql = "SELECT day, clerk_name, day_shift, night_shift
FROM animal_schedules
JOIN animal_clerks USING (id_clerk)
WHERE day >= '2019-10-05'
ORDER BY day, status, clerk_name";
foreach ($modx->query($sql) as $animal) {
echo '<li> <p class="timetable-date">'.$animal['day'].'<p class="timetable-doctors"><span>'.$animal['clerk_name'].'</span></p><li>';
}
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