Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Trader (http://www.bvlist.com/forumdisplay.php?f=29)
-   -   Edit or torrent update error (http://www.bvlist.com/showthread.php?t=12332)

Botanicar 10th February 2021 23:15

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.


darkalchemy 10th February 2021 23:23

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 = ''.

Botanicar 10th February 2021 23:27

Quote:

Originally Posted by darkalchemy (Post 55310)
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");

https://i.postimg.cc/htggTKH4/Untitled.png

mogo 10th February 2021 23:29

:)
 
Quote:

Originally Posted by Botanicar (Post 55308)
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

darkalchemy 10th February 2021 23:34

Quote:

Originally Posted by Botanicar (Post 55311)
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.

Botanicar 10th February 2021 23:42

Quote:

Originally Posted by darkalchemy (Post 55313)
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


darkalchemy 10th February 2021 23:45

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

Botanicar 10th February 2021 23:57

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
....
....
....

darkalchemy 11th February 2021 00:00

Quote:

Originally Posted by Botanicar (Post 55316)
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.

joeroberts 11th February 2021 00:52

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.


All times are GMT +2. The time now is 01:42.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.