So, that was fun. I guess my host or something changed something because what used to be save-able (sp?) in modx, is now not.
This is why certain snippets wouldn’t save:
<?php
$query = "SELECT *
FROM `table`
WHERE `id` = '1200'
AND `id_2` = (SELECT `id_2` FROM `table_2` WHERE `id_a` = 'fun' LIMIT 1)
AND `id_3` = (SELECT `id_3` FROM `table_2` WHERE `id_b` = 'stuff' LIMIT 1)";
?>
Yep, that was it. A nested query. So in order to make it work I had to do this.
<?php
$hold_sql_1 = "SELECT `id_2` FROM `table_2` WHERE `id_a` = 'fun' LIMIT 1";
$hold_sql_2 = "SELECT `id_3` FROM `table_2` WHERE `id_b` = 'stuff' LIMIT 1";
$query = "SELECT *
FROM `table`
WHERE `id` = '1200'
AND `id_2` = ($hold_sql_1)
AND `id_3` = ($hold_sql_2)";
?>
So is there a proper way to do a nested query like this that won’t cause me to go crazy?
I really appreciate your help. I may yet try the modifications to the .htaccess file. I just don’t want to creat a security risk.
Won’t updating to a newer version of modx messup how modules and other things work? I really would like to, but have a hard time fixing a working site. But then again, if I can prevent it from being hacked, then it would be worth it.