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
Error syntax
Controls ·  Search New posts · Mark unread

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

2026-01-22 18:51:42
hello and when you upload a torrent with the tmdb link then click on send I have a syntax error like below but when you click on browse torrent the torrent is present with the link and the tmdb layout

Database Error in torrents-upload.php on line 293: 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 'tmdb= '2026-01-22 18:16:21',visible='yes' WHERE id='22'' at line 1. Query was: UPDATE torrents SET leechers='-1', seeders='-1',times_completed='-1',last_action,tmdb= '2026-01-22 18:16:21',visible='yes' WHERE id='22'.



my code in torrents-upload.php is like below:

Code :



$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action, tmdb) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."', ".sqlesc($tmdb).")");


thank you in advance for your help because I have been modifying for hours and still the same problem

Last edited by niki on 2026-01-22 18:53:16
2026-01-22 21:27:26
seems like last_action is not getting any data, and the tmdb seems to be getting the data for last_action. I dont think tmdb should be a date right? I dont use tmdb, so Im just looking at your error. Possibly this
".sqlesc($tmdb)."
should be this
".sqlesc($_POST['tmdb'])."
Not sure, just a guess
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 2026-01-22 23:38:14
2026-01-23 06:26:42
Thanks for your help, MicroMonkey. I still get the same error message when I click on the “send torrent” button on the torrents-upload.php page, and when I go to the torrent list, the torrent with the TMDB description is there. 😕



Database Error. Please report this to an administrator.

Database Error in torrents-upload.php on line 293: 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 'tmdb= '2026-01-23 06:16:26',visible='yes' WHERE id='23'' at line 1. Query was: UPDATE torrents SET leechers='-1', seeders='-1',times_completed='-1',last_action,tmdb= '2026-01-23 06:16:26',visible='yes' WHERE id='23'.


$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action, tmdb) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."', ".sqlesc($_POST['tmdb']).")");
Last edited by niki on 2026-01-23 06:30:08
2026-01-23 11:45:04
Hello and I just did a test and it works well when sharing a torrent locally and it does not work with external torrents?  🙄


$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action, tmdb) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."', ".sqlesc($tmdb).")");


Last edited by niki on 2026-01-23 12:19:00
2026-01-23 18:12:08
last_action is the problem here. Also, TMDB shouldnt be a date or timestamp, so your query is wrong. You have malformed data being sent. Its putting the data for last action in the tmdb spot. Can you post your torrent upload page code? Does your external scrape in that same file look like this?
//EXTERNAL SCRAPE
if ($external == 'yes' && $site_config['UPLOADSCRAPE']) {
   $tracker = str_replace("/announce", "/scrape", $announce);    
   $stats = torrent_scrape_url($tracker, $infohash);
   
   // Sanitize and ensure non-negative values
   $seeders = max(0, (int)strip_tags($stats['seeds']));       // Force to 0 if negative
   $leechers = max(0, (int)strip_tags($stats['peers']));      // Force to 0 if negative
   $downloaded = max(0, (int)strip_tags($stats['downloaded'])); // Force to 0 if negative

   SQL_Query_exec("UPDATE torrents SET leechers='$leechers', seeders='$seeders', times_completed='$downloaded', last_action='".get_date_time()."', visible='yes' WHERE id='$id'");
}
//END SCRAPE
also have a look at this https://torrenttrader.uk/post/10731/last/#last
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 2026-01-23 20:23:26
2026-01-26 09:56:05
Hello, and thank you for your help, but I cannot find the scrape code in my files. I am sending you the three files.

download.zip
Download
functions.zip
Download
torrents-details.zip
Download
Last edited by niki on 2026-01-26 09:56:36
2026-01-26 10:36:34
your files look fine. just need to find out why that sql query is wrong
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)
2026-02-27 11:10:11
OK thanks  👍
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