[ic] Two sql questions
Wed, 1 Nov 2000 20:13:10 -0500
Quoting Kaare Rasmussen (email@example.com):
> Can I get something like this to work:
> [query sql=select count(*) from addresstype]
> [seti rowsfound]
> [sql-param count]
> I want to place the number of rows in the addresstype table in scratch
1. Have a SQL database
2. Quote your query sql= parameter
3. Use [sql-pos 0] to access the return value
then it will work. You can use this to test it, as I did:
[query sql="select count(*) from country" list=1]
[sql-pos 0] countries
> Question 2:
> How many rows will this construct read at a time?
> [query more=1 ml=10 list=1 sql="select * from address"]
> [sql-code] [sql-param field]<BR>
It will select all of them. It would make sense to use a "limit"
parameter if your DB supports it.
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <firstname.lastname@example.org>
Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
-- Winston Churchill