Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 10th February 2021, 23:15
Botanicar's Avatar
Botanicar Botanicar is offline
Senior Member
 
Join Date: Jun 2013
Croatia
Posts: 127
Default Edit or torrent update error
Hi guys,
some idea about this error when I try to editing / updating my torrent:

Code:
Database Error in torrents-edit.php on line 188:
Data truncated for column 'freeleech' at row 1.
Query was: UPDATE torrents SET name = 'Deps.1974.HDTV.1080p.x264',
url = 'https://www.imdb.com/title/tt0181468/',
descr = 'Torrent description',
category = 4,
sticky = 'yes',
recommended = 'no',
torrentlang = 10,
torrentgenres = 1,
banned = 'no',
visible = 'yes',
tube = 'https://www.youtube.com/watch?v=kuTBea8_-LY',
freeleech = '',
anon = 'no',
webseed = '',
image1 = '7140.jpg' WHERE id = 714.
Reply With Quote
  #2  
Old 10th February 2021, 23:23
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Whats the column definition for freeleech? It's expecting something and getting a string. I suspect it's supposed to be an int.

So, the query should probably be freeleech = 0, not freeleech = ''.
Reply With Quote
  #3  
Old 10th February 2021, 23:27
Botanicar's Avatar
Botanicar Botanicar is offline
Senior Member
 
Join Date: Jun 2013
Croatia
Posts: 127
Default
Quote:
Originally Posted by darkalchemy View Post
Whats the column definition for freeleech? It's expecting something and getting a string. I suspect it's supposed to be an int.

So, the query should probably be freeleech = 0, not freeleech = ''.

Row 188: SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");

Click the image to open in full size.
Reply With Quote
  #4  
Old 10th February 2021, 23:29
mogo mogo is offline
Senior Member
 
Join Date: Jun 2020
P2P
Posts: 94
Default :)
Quote:
Originally Posted by Botanicar View Post
Hi guys,
some idea about this error when I try to editing / updating my torrent:

Code:
Database Error in torrents-edit.php on line 188:
Data truncated for column 'freeleech' at row 1.
Query was: UPDATE torrents SET name = 'Deps.1974.HDTV.1080p.x264',
url = 'https://www.imdb.com/title/tt0181468/',
descr = 'Torrent description',
category = 4,
sticky = 'yes',
recommended = 'no',
torrentlang = 10,
torrentgenres = 1,
banned = 'no',
visible = 'yes',
tube = 'https://www.youtube.com/watch?v=kuTBea8_-LY',
freeleech = '',
anon = 'no',
webseed = '',
image1 = '7140.jpg' WHERE id = 714.

Very general would look like the code of i3on and TTCE
Reply With Quote
  #5  
Old 10th February 2021, 23:34
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Quote:
Originally Posted by Botanicar View Post
Row 188: SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");
This actually does not show me the query itself or the column definition.

I suspect the value of $updatedset is what you posted. The column definition can be found by running, in mysql:

Code:
SHOW CREATE TABLE torrents
and look at the freeleech column.
Reply With Quote
  #6  
Old 10th February 2021, 23:42
Botanicar's Avatar
Botanicar Botanicar is offline
Senior Member
 
Join Date: Jun 2013
Croatia
Posts: 127
Default
Quote:
Originally Posted by darkalchemy View Post
This actually does not show me the query itself or the column definition.

This is resultate



Code:
CREATE TABLE `torrents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `info_hash` varchar(40) DEFAULT NULL,
  `name` varchar(255) NOT NULL DEFAULT '',
  `filename` varchar(255) NOT NULL DEFAULT '',
  `save_as` varchar(255) NOT NULL DEFAULT '',
  `descr` text NOT NULL,
  `image1` text NOT NULL,
  `image2` text NOT NULL,
  `category` int(10) unsigned NOT NULL DEFAULT 0,
  `size` bigint(20) unsigned NOT NULL DEFAULT 0,
  `added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `type` enum('single','multi') NOT NULL DEFAULT 'single',
  `numfiles` int(10) unsigned NOT NULL DEFAULT 0,
  `comments` int(10) unsigned NOT NULL DEFAULT 0,
  `views` int(10) unsigned NOT NULL DEFAULT 0,
  `hits` int(10) unsigned NOT NULL DEFAULT 0,
  `times_completed` int(10) unsigned NOT NULL DEFAULT 0,
  `leechers` int(10) unsigned NOT NULL DEFAULT 0,
  `seeders` int(10) unsigned NOT NULL DEFAULT 0,
  `last_action` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `visible` enum('yes','no') NOT NULL DEFAULT 'yes',
  `banned` enum('yes','no') NOT NULL DEFAULT 'no',
  `owner` int(10) unsigned NOT NULL DEFAULT 0,
  `anon` enum('yes','no') NOT NULL DEFAULT 'no',
  `numratings` int(10) unsigned NOT NULL DEFAULT 0,
  `ratingsum` int(10) unsigned NOT NULL DEFAULT 0,
  `nfo` enum('yes','no') NOT NULL DEFAULT 'no',
  `announce` varchar(255) NOT NULL DEFAULT '',
  `external` enum('yes','no') NOT NULL DEFAULT 'no',
  `torrentlang` int(10) unsigned NOT NULL DEFAULT 1,
  `freeleech` enum('0','1') NOT NULL DEFAULT '0',
  `url` varchar(80) CHARACTER SET utf8 DEFAULT NULL,
  `tube` varchar(100) DEFAULT NULL,
  `sticky` enum('yes','no') DEFAULT 'no',
  `thanks` longtext DEFAULT NULL,
  `webseed` enum('0','1') NOT NULL DEFAULT '0',
  `recommended` enum('yes','no') NOT NULL DEFAULT 'no',
  `torrentgenres` int(10) unsigned NOT NULL DEFAULT 100,
  PRIMARY KEY (`id`),
  UNIQUE KEY `info_hash` (`info_hash`(20)),
  KEY `owner` (`owner`),
  KEY `visible` (`visible`),
  KEY `category_visible` (`category`,`visible`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=717 DEFAULT CHARSET=latin1
Reply With Quote
  #7  
Old 10th February 2021, 23:45
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
As you can see it requires freeleech to be either 0 or 1 not and empty string.

In you code, change freeleech = '' to freeleech = 0
Reply With Quote
  #8  
Old 10th February 2021, 23:57
Botanicar's Avatar
Botanicar Botanicar is offline
Senior Member
 
Join Date: Jun 2013
Croatia
Posts: 127
Default
If freeleech (or other options) is not checked I have that error.
Like that:
Freeleech -> unckecked = error
Freeleech -> ckecked = OK
Webseed -> unckecked = error
Webseed -> ckecked = OK
Recommended -> unckecked = error
Recommended -> ckecked = OK
....
....
....
Reply With Quote
  #9  
Old 11th February 2021, 00:00
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
Quote:
Originally Posted by Botanicar View Post
If freeleech (or other options) is not checked I have that error.
Like that:
Freeleech -> unckecked = error
Freeleech -> ckecked = OK
Webseed -> unckecked = error
Webseed -> ckecked = OK
Recommended -> unckecked = error
Recommended -> ckecked = OK
....
....
....
Each of those have a default in the database, so unless you setting 'yes' or 1, remove it from the query as they are not needed. Otherwise, they must be set to either 0 or 1 for the first 2 and yes or no for the last one.
Reply With Quote
  #10  
Old 11th February 2021, 00:52
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
well First off lets start with what version of Torrent Trader are you working with?
fast way please show the file torrents-edit.php
seems like this file is trying to enter yes no rather then 0 1 so the error needs to be traced down.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 15:31. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.