Dear Dan,

I don't know if I understood what you really want. Therefore I will try to help, ok.

I use Postgres as Database.

You can find out how many rows have in a table after you run a SQL like this.

#!/usr/bin/perl

use Pg;
$db        = Pg::connectdb("dbname=database");

# This is a way to do it.

$result = $db->exec("SELECT * FROM table;");
$number_of_row = $result->ntuples;
print $number_of_row;

# This is another way to do it.

$result = $db->exec("SELECT count(*) FROM table;");
$number_of_row = $result->getvalue(0, 0);
print $number_of_row;

Best regards,

Na Sunday, 29 de September de 2002 ŕs 09:44:40 PM, dan escreveu:

> How is it possible to cycle through an SQL table row by row, without having
> to increment an ID by 1 in a while loop and go
> SELECT * FROM table WHERE id=$id
> ?
> And how can I find out how many rows are in the table?
> 
> Dan
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 



Cleiton L. Siqueira
Colégio Monjolo
[EMAIL PROTECTED]
(0xx45) 520-1915

Esta mensagem foi enviada pelo sistema MONJOLO WEBMAIL

http://www.colegiomonjolo.com.br


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to