[ic] query tag usage

Kevin Walsh interchange-users@icdevgroup.org
Wed Jun 11 06:00:01 2003


Jonathan Clark [jonc@webmaint.com] wrote:
> > >>
> > >> I'm trying to do use the query tag in IC 4.9.7 to pull some data from
> > >> a  MySQL 4.1 database, and haven't gotten too far.  The following
> > >> code:
> > >>
> > >> ----------------------------------------
> > >>     [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]?
> 
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?

  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".

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/