sorting SQL results with dtml-in - not working
Hi, I am trying to provide a way to re-sort sql results in the form of a table by column name. I have the column headings set as links which pass the sort order via the query string (<a href="http://ut-web/applications/iw/plancheck/show_all_html2?order=Company"> Company</a> ) On the called page, I have the following line to sort the sql results but it seems to sort by something else and seems to be different each time. <dtml-in list_all_records sort="<dtml-var order> reverse" size=10 start=query_start> Order is the name of the variable for each database field. For example, sort could equal "Company" For whatever reason, I am getting weird results. I am still pretty weak at dtml so I am not seeing why. Sean
On Fri, Jun 28, 2002 at 11:07:05AM -0700, Kelley, Sean wrote:
<dtml-in list_all_records sort="<dtml-var order> reverse" size=10 start=query_start>
For whatever reason, I am getting weird results. I am still pretty weak at dtml so I am not seeing why.
Because you should not nes DTML inside DTML. What is inside "" must be Python. <dtml-in list_all_records sort="order" reverse size=10 start=query_start> Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@email.ru Programmers don't die, they just GOSUB without RETURN.
On Fri, Jun 28, 2002 at 11:07:05AM -0700, Kelley, Sean wrote: | Hi, | I am trying to provide a way to re-sort sql results in the form of a table | by column name. I have the column headings set as links which pass the sort | order via the query string This sounds fine, but why not let the SQL backend do the sorting for you? Use the "ORDER BY <column name>" clause on your query. You can have the column to order by passed in as an argument (as you are trying to do). HTH, -D -- All a man's ways seem innocent to him, but motives are weighed by the Lord. Proverbs 16:2 http://dman.ddts.net/~dman/
participants (3)
-
Derrick 'dman' Hudson -
Kelley, Sean -
Oleg Broytmann