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
TorrentTrader 3.0 install clean
Controls ·  Search New posts · Mark unread

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

2023-07-29 13:00:39
Hello  😊

I just changed servers and did a fresh install.

But I got an error when editing the poll and I made no changes.

SQL Error has Edit:
Database Error in admincp.php on line 1793: Data truncated for column 'sort' at row 1. Query was: INSERT INTO polls VALUES(0, '2023-07-29 12:54:10', 'Do You Like This Site', 'Excellent', 'Its ok', 'Its my first visit', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0).


Thank you for your support as always!  👍
admincp.rar
Download

Last edited by spiritblue on 2023-07-29 13:01:30
2023-07-29 16:30:01
Make your empty parameters to ALLOW NULL, that way it auto-fills with a default value with the absence of filled parameters. This is make much shorter queries, will handle issues by itself, and will be easier to follow the SQL from a birds eye view.
2023-07-29 16:38:31
disable mysql strict mode. I think thats where your issue is
SHOW VARIABLES LIKE 'sql_mode';
should look like this, if not, change it
Screenshot 2023-07-29 124329.jpg
Screenshot 2023-07-29 124329.jpg

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 2023-07-29 16:44:06
2023-07-29 19:03:51
MicroMonkey avais donné la réponse le 2023-04-21
[14:59]
Link:`https://torrenttrader.uk/post/10585
et j'ai testé et c'est bien çà !

l'erreur etait  $sort = (int)$_POST["sort"];   supprime-le (int) s'est lui qui donnée erreur
=====================

MicroMonkey gave the answer on 2023-04-21
[14:59]
Lien : https://torrenttrader.uk/post/10585
and i tested it and that's it !

the error was $sort = (int)$_POST["sort"]; delete it (int) it gave him an error


* (Merci à Gollum de son aide et à vous tous)


Last edited by spiritblue on 2023-07-29 19:06:13
2023-07-29 20:11:22
github edited and commented. Thanks for pointing it out spritblue. The poll is one of those rarely used features, so if it has a bug, most people dont even know it
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 2023-07-29 20:20:29
2023-07-29 20:25:00
MicroMonkey Cool!

Thank you and always a pleasure to be able to help in my way ! 👍  💣
==============
Merci et toujours un plaisir de pouvoir aide à ma façon  !  👍  💣
Last edited by spiritblue on 2023-07-29 20:25:52
2023-07-30 17:35:24
this seems like a better idea for the post data. I learned from STorrents that you should sanitize the input on POST, so what do you think? I tested it on my copy, Im just gunna add this to git. Pollid and sort dont need sanitized. Seems reasonable. I been using FILTER_SANITIZE as I go through my code. Works well as long as I put it where it belongs lol. Yea, I screw it up alot. Do we really need 19 options on this stupid thing? lol
if ($action == "polls" && $do == "save") {
   $subact = filter_input(INPUT_POST, 'subact', FILTER_SANITIZE_STRING);
   $pollid = (int)$_POST["pollid"];

   $question = filter_input(INPUT_POST, 'question', FILTER_SANITIZE_STRING);
   $option0 = filter_input(INPUT_POST, 'option0', FILTER_SANITIZE_STRING);
   $option1 = filter_input(INPUT_POST, 'option1', FILTER_SANITIZE_STRING);
   $option2 = filter_input(INPUT_POST, 'option2', FILTER_SANITIZE_STRING);
   $option3 = filter_input(INPUT_POST, 'option3', FILTER_SANITIZE_STRING);
   $option4 = filter_input(INPUT_POST, 'option4', FILTER_SANITIZE_STRING);
   $option5 = filter_input(INPUT_POST, 'option5', FILTER_SANITIZE_STRING);
   $option6 = filter_input(INPUT_POST, 'option6', FILTER_SANITIZE_STRING);
   $option7 = filter_input(INPUT_POST, 'option7', FILTER_SANITIZE_STRING);
   $option8 = filter_input(INPUT_POST, 'option8', FILTER_SANITIZE_STRING);
   $option9 = filter_input(INPUT_POST, 'option9', FILTER_SANITIZE_STRING);
   $option10 = filter_input(INPUT_POST, 'option10', FILTER_SANITIZE_STRING);
   $option11 = filter_input(INPUT_POST, 'option11', FILTER_SANITIZE_STRING);
   $option12 = filter_input(INPUT_POST, 'option12', FILTER_SANITIZE_STRING);
   $option13 = filter_input(INPUT_POST, 'option13', FILTER_SANITIZE_STRING);
   $option14 = filter_input(INPUT_POST, 'option14', FILTER_SANITIZE_STRING);
   $option15 = filter_input(INPUT_POST, 'option15', FILTER_SANITIZE_STRING);
   $option16 = filter_input(INPUT_POST, 'option16', FILTER_SANITIZE_STRING);
   $option17 = filter_input(INPUT_POST, 'option17', FILTER_SANITIZE_STRING);
   $option18 = filter_input(INPUT_POST, 'option18', FILTER_SANITIZE_STRING);
   $option19 = filter_input(INPUT_POST, 'option19', FILTER_SANITIZE_STRING);
   $sort = $_POST["sort"];

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 2023-07-31 02:09:42
2023-08-02 20:28:10
Hello MicroMonkey Even if the problem has been corrected as said above I tested your line of code and it gave me this error

Database Error in admincp.php on line 2124: Data truncated for column 'sort' at row 1. Query was: INSERT INTO polls VALUES(0, '2023-08-02 20:25:31', 'test', 1, 2, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '').

2023-08-02 21:40:21
weird, because its ENUM YES:NO in that code above also, it just sanitizes the text input. Im not sure what you got going on. I cant duplicate it. Data being truncated means your data is too long for the sort, which should only be an ENUM. You may have an error elsewhere, I dont know. Just use the code that works. I think it may have something to do with sqlesc(), but my code is different a bit, just use what works, no reason to overthink it, or switch this in my code above.
$subact = $_POST["subact"];

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 2023-08-02 21:53:43
2023-08-03 02:24:12
Ok but just wanted to let you complete your choice as a test my friend nothing more but you are right I will keep what works #1  😊
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