Aug 30, 2012View SourceYou could use something like:
Would give an array of rows which match the query "col4=value" and sorts by col2
$queryResults["col1"] will give the value of "col1" on the first row. (assuming that there are rows in the result)
-JasonOn Thu, Aug 30, 2012 at 6:52 PM, michaelbluejay <yh327@...> wrote:
I know that the documentation purportedly explains how to do queries, but I find it exceptionally difficult to understand, and the lack of practical examples doesn't help.
So given this query:
mydata = db(fieldValue).select("col1", "col2", "col3");
How would I order the results by col2? I saw on the "Working with Data" page about db.order(), but I have no idea where it goes or what the syntax looks like when I'm trying to apply it to an existing query.
Thank you very much for your help.