1
Hi there folks.
I'm working on a module and ran into a problem while using the $xoopsDB->query function.
This statement works:
"SELECT recid,name FROM xoops_newmod_table
UNION ALL
SELECT recid,name FROM xoops_newmod_table2;"
This statement does not work, and returns no error:
"(SELECT recid,name FROM xoops_newmod_table)
UNION ALL
(SELECT recid,name FROM xoops_newmod_table2);"
I've tested the statements through the 'mysql' command line tool and found both to return correct results.
I need the second one so I can put "ORDER BY recid" on the tail end of that SQL statement; "ORDER BY" will only work when the two SELECT statements are encapsulated with paren ().
I was able diagnose this to the point where I can tell you that the central queryF function found inside of class/database/mysqldatabase.php, was not being called for the non-working SQL. It is being called for the functional SQL though. Something is getting in the way.
From that point I am unsure of how "$xoopsDB->query($sql)" function passes it's arguments over to the mysqldatabase.php functions otherwise I'd follow the trail back... I was under the impression that $xoopsDB is just a piece of the databasefactory, but I just can't find where it's getting lost.
In the meantime I can just skip over the use of $xoopsDB and hit the MySQL directly, but I really would prefer to use the XOOPS functions.
Any clues would be appreciated.
Thanks in advance,
John