Re: Last row in table

2002-11-01 Thread gerald_clark
You have not fetched any data yet. I would suggest reading the DBI/DBD docs, and some working programs. Aamer Rauf wrote: In my perl script I do the following: my $sth = $dbh->prepare("SELECT MAX(Id) FROM sometable"); my $id = $sth->execute(); print "id: $id\n"; It prints 1 which I guess is th

Re: Last row in table

2002-10-31 Thread Aamer Rauf
In my perl script I do the following: my $sth = $dbh->prepare("SELECT MAX(Id) FROM sometable"); my $id = $sth->execute(); print "id: $id\n"; It prints 1 which I guess is the number of rows selected. I was expecting that it would give me the highest id in that table. How can I get that? Thanks for

Re: Last row in table

2002-10-31 Thread Michael T. Babcock
Petre Agenbag wrote: also makes sense to me to be able to have a get_last_entry() function, or a total_rows_in table() (well, I guess you can do that with a select I'm sure I've said it personally a dozen times (and the archives probably show many other people saying it too); you're not thin

Re: Last row in table

2002-10-31 Thread Roger Baklund
* Petre Agenbag [...] > I did the last write to the table maybe a day ago, but I want to write a > script that can give me some "stats" on the table at any time, so it > also makes sense to me to be able to have a get_last_entry() function, > or a total_rows_in table() (well, I guess you can do tha

re: Last row in table

2002-10-31 Thread Petre Agenbag
Hi I want to "barge" in on this question, as it has bothered me in the past as well. The reason being: I did the last write to the table maybe a day ago, but I want to write a script that can give me some "stats" on the table at any time, so it also makes sense to me to be able to have a get_last_e

re: Last row in table

2002-10-31 Thread Egor Egorov
Aamer, Wednesday, October 30, 2002, 8:34:44 PM, you wrote: AR> I have a mysql database. Lets say it has a table called "maintable" with primary AR> key as main_id. I want to add other tables to the database and use main_id as AR> foriegn keys in those tables. If I want to start with the last row