Re: Same user appears 3 times in the online list
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on (user_id,ident)' at line 1
MySQL - 4.1.19-standard
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 bug reports → Same user appears 3 times in the online list
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on (user_id,ident)' at line 1
MySQL - 4.1.19-standard
Edited the query, try now
that worked, hopefully that will fix it. thanks!
Hi Smartys.
I have changed as you wrote 2005-08-23 20:47:40 and made the table entry to mysql as you wrote 2006-07-28 22:47:02 and I get following Error:
File: /homepages/26/d34113660/htdocs/forumgalopp/upload/include/functions.php
Line: 103
PunBB reported: Unable to insert into online list
Database reported: Duplicate entry '8-Nobody' for key 1 (Errno: 1062)
Line 103 in functions as follows:
$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
There's no such query in my changes
I just updated the queries a little, try now
and tell me what database system you're using
thanks,
it looks that it will work now
thanks for your support.
I have applied the fix and am getting multiple entries of the post. If 5 guests are online the post shows 4 times, 9 guests it shows 8 times etc.
Also mysql reporting
UNIQUE and INDEX keys should not both be set for column `user_id`
Running MySQL 4.1.21-standard
Any ideas? I have the online today mod installed if that makes a difference.
soonotes: If you don't add the index, then the changed code makes no difference
And from Googling for that error, it's not actually an error, it's a phpMyAdmin issue: I assume that's what you were using?
Yes, phpMyAdmin is showing as a warning. The index is added but still get the posts repeated.
Then something is wrong with your setup: the code has worked perfectly fine for everyone else who has applied it.
Take a look at this
http://dev.punbb.org/changeset/773#file1
Doesn't work perfectly for me lol. I think it is related to the option I added for a user to choose whether or not they show in the online list and the resulting row 'show_online' in the online table. I'll have to do some looking here.
Make sure you edited $db_type into the global variable declaration.
Not working. Yes, I added $db_type. I've compared my functions.php with a vanilla one and see nothing to cause this. Nothing is getting 'replaced' in the table and a debug shows a query of
UPDATE prefixonline SET logged=1168896088 WHERE ident='x.x.x.x'
I'm not an expert on this stuff but looking at functions.php it seems to me that this query is from
// Special case: We've timed out, but no other user has browsed the forums since we timed out
if ($pun_user['logged'] < ($now-$pun_config['o_timeout_visit']))
{
$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
$pun_user['last_visit'] = $pun_user['logged'];
}
and shouldn't be happening unless no guest has browsed the forum in the timeout period.
That's the wrong query
http://dev.punbb.org/browser/trunk/uplo … ctions.php
Line 150
What version of PunBB are you running, btw? Guests don't affect the online indicator except in a bugged version of 1.2.6 (or something like that)
Running 1.2.14 updated from 1.2.12 and that query is the exact same one that's in the link you posted so I am a bit lost with what you're saying.
BTW, many thanks for taking the time here. Is there anything else I can tell you to help?
Did you install the attachment mod by any chance?
No
Make sure you've applied this changeset to your viewtopic.php
http://dev.punbb.org/changeset/172
You are a god! I had just replaced functions.php with a vanilla one which made no difference. The date on that changeset predates 1.2.12 I believe which is what I started with so I must have messed up with a mod. I don't know how to thank you.
PunBB Forums → PunBB 1.2 bug reports → Same user appears 3 times in the online list
Powered by PunBB, supported by Informer Technologies, Inc.