[ic] query tag usage (solved)
Interchange User
interchange-users@icdevgroup.org
Wed Jun 11 07:11:01 2003
>>>>> [query
>>>>> sql="select * FROM nc_authorarticle where articleID = '31'"
>>>>> type=list
>>>>> list=1
>>>>> more=1
>>>>> ml=100
>>>>> st=db
>>>>> ]
>>>>> [on_match]
>>>>> Match:[sql-field authorDisplay] [sql-field articleID]
>>>>> [sql-field authorship]<br>
>>>>> [/on_match]
>>>>> [/query]
>>>>>
>>>> Change your [on-match]...[/on-match] to [list]...[/list].
>>>
>>> Tried it, but got the same results. It seems to find the data that I
>>> want, but I just can't get it to display.
>>
>> And did you try my reply which said to use [sql-param] instead of
>> [sql-field]?
Changing my results code to
Match:[sql-param authordisplay] [sql-param articleid]
[sql-param authorship]<br>
works like a charm.
> I didn't notice the [sql-field] usage. Yes - try [sql-param]. Also,
> do the following:
>
> 1. List your columns instead of using '*' (for efficiency). Why
> select and transfer the entire row when you only need to use
> a couple of columns?
Thanks, but I need all the columns, in this case. Okay, not in this
specific case, since I was just trying to get the bloody thing working,
but in the end I will. :)
> 2. Use lower-case column names. MixedCaseColumnNames are ugly and
> are not supported by DBI. You can use underscores to separate
> words
> in column names if you need to. For instance, use "article_id"
> instead of "articleID".
That is what made the difference. I had previously tried sql-param,
from one of the examples, but the mixed-case column names is what threw
off the results. I can't claim credit for the design though - I'm
using an existing database that my client has me working on.
Thank you Jonathan and Kevin (and anyone else that I may have missed)!
Peter