Here's my table structure (very simple):
id quote
Using the MTSQL plugin, here's the code:
CODE
<MTSQL query="SELECT id, quote, RAND() as r FROM quotes ORDER BY r LIMIT 1"><MTSQLColumn column='2'></MTSQL>
Now I can run the query in phpMyAdmin and I get a random record from the table in the results pane. I'm reasonably confident that it's correct from a SQL perspective. However, when I use the above code on my page, I only seem to get the first quote in the table each time. No amount of refreshing the page gives me another quote.
So, a few questions:
1. Is my syntax with the MTSQL plugin correct?
2. Do I need to close the <MTSQLColumn> tag? I think I threw in a </MTSQLColumn> before </MTSQL> but the actual text of the tag showed up in the resulting page source when viewed in the browser.
Any help? Thanks.