Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Db error when updating torrent stats
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2021-08-02 02:17:14
Getting this error when I click update stats at FireTorrents.org

 Database Error in torrents-details.php on line 189: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `url` = 'http://tracker.bt4g.com:2095/announce' AND `torrent` = 13' at line 1. Query was: UPDATE `announce` SET `online` = 'yes', `seeders` = 0, `leechers` = 0, `times_completed` = WHERE `url` = 'http://tracker.bt4g.com:2095/announce' AND `torrent` = 13.


Running TTv3.0
Mysql Version: 10.1.48-MariaDB-0ubuntu0.18.04.1
PHP Version: 7.3.29-1+ubuntu18.04.1+deb.sury.org+1
Apache Version: nginx/1.14.0

Let me know what to do please.
Last edited by Variant on 2021-08-02 07:19:33
2021-08-02 10:42:33
 `times_completed` = WHERE 


should say
 `times_completed` = 0 WHERE 


whats on torrents-details.php on line 189

looking for where the `times_completed` is coming from
2021-08-02 13:52:49
On line 189 is this :

  SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
               } else {
                   SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

               }
2021-08-03 08:54:45
Mine look like this:
SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '".$stats['seeds']."', `leechers` = '".$stats['peers']."', `times_completed` = '".$stats['downloaded']."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");
}
else
{
SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");
}

Last edited by coco on 2021-08-03 08:57:59
2021-08-03 19:36:27
I keep mentioning this, but make sure SQL strict mode is turned off. It will cause all kinds of errors that get hard to trace. If you turn it off, then things get simpler.
putty in to your server, or use terminal, add to the bottom of my.cnf by editing it using sudo nano /etc/mysql/my.cnf
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION

restart mysql server
sudo service mysql restart

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-08-03 19:42:16
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728