I am trying to query the database within a snippet within ModX Revo:
<?php
$leadersql = "SELECT * FROM `modx_menus`";
$result = mysql_query($leadersql);
while ($row = mysql_fetch_array($result)) {
echo "hello";
};
?>
On Evo this worked fine but returns nothing in Revo.
Do I need to set it up differently?
Christian’s code does work you may need to define the $rows array first:
if not:
– you do have menu items defined?
– you are calling your snippet uncached?