Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Weird Record Number (-2)

Quote Reply
Weird Record Number (-2)
Okay...I've rewritten my "total users online" subroutine since I noticed that it was not taking the DISTINCT number of rows from the Sessions table. The problem is that now the number has a - character attached to it.

You can see what I mean at:

http://members.anthrotech.com

Here is the query I am using:

Code:

sub get_totalonline {
#-----------------------------------------------------
my ($USERSESSDB);
$USERSESSDB = new Links::DBSQL $CUSTOM{members_def} . "Sessions.def";
my $query = qq|SELECT DISTINCT(UserID) FROM Sesssions|;
my $sth = $USERSESSDB->prepare($query);
$sth->execute();
my $hits = $sth->rows;
return $hits;
}


Of course, if my hosting company upgraded to the next version of MySQL where my anthrotech databases are stored, I could use COUNT(DISTINCT(UserID)) in the above SQL statement. But since they aren't planning on upgrading this particular MySQL server, I am stuck with using legacy MySQL functions/codes. [sad]

Anyway...does anyone see something I am missing with the above query that is inserting negative signs before the number???

Thanks in advance for any suggestions!

Regards,

Eliot Lee Wink
http://anthrotech.com/
Subject Author Views Date
Thread Weird Record Number (-2) Stealth 1897 Jul 14, 2001, 8:31 AM
Thread Re: Weird Record Number (-2)
Alex 1864 Jul 16, 2001, 11:51 AM
Post Re: Weird Record Number (-2)
Stealth 1856 Jul 16, 2001, 7:54 PM