|
#1
|
||||
|
||||
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. |
#2
|
|||
|
|||
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 = ''. |
#3
|
||||
|
||||
|
#4
|
|||
|
|||
:)
Quote:
Very general would look like the code of i3on and TTCE |
#5
|
|||
|
|||
Quote:
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 |
#6
|
||||
|
||||
Quote:
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 |
#7
|
|||
|
|||
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 |
#8
|
||||
|
||||
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 .... .... .... |
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
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/ |
|
|