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:


Here is the query I am using:


sub get_totalonline {
$USERSESSDB = new Links::DBSQL $CUSTOM{members_def} . "Sessions.def";
my $query = qq|SELECT DISTINCT(UserID) FROM Sesssions|;
my $sth = $USERSESSDB->prepare($query);
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!


Eliot Lee Wink
Subject Author Views Date
Thread Weird Record Number (-2) Stealth 2141 Jul 14, 2001, 8:31 AM
Thread Re: Weird Record Number (-2)
Alex 2096 Jul 16, 2001, 11:51 AM
Post Re: Weird Record Number (-2)
Stealth 2087 Jul 16, 2001, 7:54 PM