Icy Phoenix

     
 

Downloads ADV Statistics returns SQL errors

Category: PHP
Version Icy Phoenix 1.3 (PHP 5.x - MySQL 5.x)
Description
buldo
Sun 18 Oct, 2009 18:54
Hi all,
I've added some "." (full stop) to "ip_root/includes/downloads/includes/dl_stats.php" because it returns some SQL errors "unexpected T_CONSTANT_ENCAPSED_STRING...".

This is one of the faulty SQL query (lines 363 to 371]:
Code: [Hide]
  1. $sql = "SELECT count(s.id) as dl_counts, s.user_id, s.username, u.username as user_username, u.user_active, u.user_color  
  2. FROM " . DL_STATS_TABLE . " s, " . USERS_TABLE " u  
  3. WHERE s.direction = 0  
  4. AND s.cat_id IN (" . implode(',', $access_cats) . ")  
  5. $sql_where  
  6. AND u.user_id = s.user_id  
  7. GROUP BY s.user_id, user_username  
  8. ORDER BY dl_counts DESC  
  9. LIMIT 10"; 


That I changed in:

Code: [Hide]
  1. $sql = "SELECT count(s.id) as dl_counts, s.user_id, s.username, u.username as user_username, u.user_active, u.user_color  
  2. FROM " . DL_STATS_TABLE . " s, " . USERS_TABLE . " u  
  3. WHERE s.direction = 0  
  4. AND s.cat_id IN (" . implode(',', $access_cats) . ")  
  5. $sql_where  
  6. AND u.user_id = s.user_id  
  7. GROUP BY s.user_id, user_username  
  8. ORDER BY dl_counts DESC  
  9. LIMIT 10"; 


The "." (full stop) to add is the one near "USERS_TABLES".

All the query after this one are affected by the same bug, so you have to add other "." on lines 408, 453 and 497 always after "USERS_TABLES".
Reply
Mighty Gorgon
Wed 21 Oct, 2009 00:35
Fixed
Details Assigned To: Mighty Gorgon
Priority: Low
Status: Fixed
Fixed: Yes
 




 

  cron