I have a link that when the user clicks on it queries that database using a method. The database is postgres. what is want is beside the link in parenthesis displaying how many rows are in that table. For example: Employees (45) Companies (46) I think you would use a counter for this right ?? How would i approach this ? The number should be dynamic so that as it increase the number will increase automatically. Thanks
I take it you just want the number of rows returned from a query. Try a query like this... select count(*) from table where [...] Oai Luong wrote:
I have a link that when the user clicks on it queries that database using a method. The database is postgres. what is want is beside the link in parenthesis displaying how many rows are in that table. For example:
Employees (45) Companies (46)
I think you would use a counter for this right ?? How would i approach this ? The number should be dynamic so that as it increase the number will increase automatically.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Ken Kinder 303.381.7631
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <38F23842.A889B4E4@messagemedia.com>, Ken Kinder <kkinder@messagemedia.com> writes
I take it you just want the number of rows returned from a query. Try a query like this...
select count(*) from table where [...]
You probably need to do this as your sql query select count(*) as total from table where <dtml-sqltest ... > and then use ( <dtml-var TOTAL> ) - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBOPHbmrTRdIWzaLpMEQLejQCg2l0/hKecOJcg6EaFMNv+4Ie1eAUAn0o5 FbNS3lCWKP0H4m9pp44NDzWG =M0fo -----END PGP SIGNATURE-----
participants (3)
-
Graham Chiu -
Ken Kinder -
Oai Luong