Query to generate all data in admin logs:
- Code: Select all
SELECT l.*, u.username, u.username_clean, u.user_colour
FROM phpbb_log l, phpbb_users u
WHERE l.log_type = 0
AND u.user_id = l.user_id
ORDER BY l.log_time DESC
LIMIT 4050, 30
Query used for counting the number of items:
- Code: Select all
mysql> SELECT COUNT(l.log_id) AS total_entries
-> FROM phpbb_log l
-> WHERE l.log_type = 0
-> AND l.log_time >= 0
-> ;
+---------------+
| total_entries |
+---------------+
| 4072 |
+---------------+
1 row in set (0.02 sec)
Problem: In the count query there is no user table relation.
Count with user table included:
- Code: Select all
mysql> SELECT COUNT(l.log_id) AS total_entries
-> FROM phpbb_log l , phpbb_users u
-> WHERE l.log_type = 0
-> AND l.log_time >= 0
-> AND u.user_id = l.user_id
-> ;
+---------------+
| total_entries |
+---------------+
| 3698 |
+---------------+
1 row in set (0.02 sec)
This is ~400 lower, what is causing the last few pages aren't working.