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

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

2021-11-24 21:56:15
Hello

i have sql error with bookmarks.php file for line # 21
SQL error:
 Database Error in bookmarks.php on line 21: 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 'ORDER BY torrents.id DESC LIMIT 0,25' at line 1. Query was: SELECT bookmarks.id as bookmarkid, users.username, users.id as owner, torrents.id, torrents.name, torrents.type, torrents.comments, torrents.leechers, torrents.seeders, ROUND (torrents.ratingsum / torrents.numratings) AS rating, categories.name AS cat_name, categories.image AS cat_pic, torrents.save_as, torrents.numfiles, torrents.added, torrents.filename, torrents.size, torrents.views, torrents.visible, torrents.hits, torrents.times_completed, torrents.category FROMmarks LEFT JOIN torrents ON bookmarks.torrents = torrents.id LEFT JOIN users on torrents.owner = users.id LEFT JOIN categories ON torrents.category = categories.id WHERE bookmarks.userid = ORDER BY torrents.id DESC LIMIT 0.25. 


Original ligne:
 list ($ pagertop, $ pagerbottom, $ limit) = pager (25, $ count, "bookmarks.php?");
$ res = SQL_Query_exec ("SELECT bookmarks.id as bookmarkid, users.username, users.id as owner, torrents.id, torrents.name, torrents.type, torrents.comments, torrents.leechers, torrents.seeders, ROUND (torrents .ratingsum / torrents.numratings) AS rating, categories.name AS cat_name, categories.image AS cat_pic, torrents.save_as, torrents.numfiles, torrents.added, torrents.filename, torrents.size, torrents.views, torrents.visible, torrents.hits, torrents.times_completed, torrents.category FROM bookmarks LEFT JOIN torrents ON bookmarks.torrentid = torrents.id LEFT JOIN users on torrents.owner = users.id LEFT JOIN categories ON torrents.category = categories.id WHERE bookmarks.userid = $ user ORDER BY torrents.id DESC $ limit ") or die (mysqli_error ($ GLOBALS [" DBconnector "]));


Thank you for your help  :smile
Last edited by spiritblue on 2021-11-24 21:57:37
2021-11-24 22:24:45
This is my part of that code, test it if you need whole files I can send you, NP


$page = (int) $_GET['page'];
$perpage = 25;
$res = SQL_Query_exec("SELECT COUNT(*) FROM bookmarks WHERE userid = " . $CURUSER["id"] ."");
$row = mysqli_fetch_array($res);
$count = $row[0];
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "bookmark.php?");

$where = "WHERE bookmarks.userid = " . $CURUSER["id"] ."";
$orderby = "ORDER BY added DESC";

$query = SQL_Query_exec("SELECT bookmarks.id as bookmarkid,
torrents.size,
torrents.freeleech,
torrents.external,
torrents.id,
torrents.category,
torrents.name,
torrents.filename,
torrents.added,
torrents.banned,
torrents.comments,
torrents.seeders,
torrents.leechers,
torrents.times_completed,
categories.name AS cat_name,
categories.parent_cat AS cat_parent,
categories.image AS cat_pic
FROM bookmarks
LEFT JOIN torrents ON bookmarks.torrentid = torrents.id
LEFT JOIN categories ON category = categories.id
$where $orderby $limit");



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-11-24 22:44:38
I think the file is called bookmark, NOT bookmarks, there are 2 files named both, perhaps your code should be
pager (25, $ count, "bookmark.php?");

I also made a correction, read this forum https://torrenttrader.uk/topic?topicid=4518
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 2021-11-24 22:48:19
2021-11-25 18:08:06
MicroMonkey:
I think the file is called bookmark, NOT bookmarks


I also suspected this in the beginning but want to test first if he has other names on this file



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-11-25 22:02:49
indeed my error was the name of the second file without S :confound
thank you MicroMonkey and thank you for your help Botanicar  :thumb  
2021-11-26 11:55:40
Cool, glad its working. In case you havent already done this, this is the count fix for that file also
.(is_countable($expandrows) && count($expandrows)?

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)
2021-11-27 16:04:17
Where do you place this line
. (is_countable ($ expandrows) && count ($ expandrows)?   :unsure
2021-12-07 16:08:33
sorry, just saw your post. bookmark.php
echo "<td class='table_col2' nowrap='nowrap'>".(is_countable($expandrows) && count($expandrows)?"<a href=\"javascript: klappe_torrent

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)
2021-12-07 22:59:21
Ah! OK! would be for mode "klappe_torrent", but for my part I do not add them and I keep like you, m thank you for answering my friend  MicroMonkey  :thumb

For those interested (Bookmark.php):
<?php
require_once("backend/functions.php");
dbconn();

$gottorrent = (int)$_GET["torrent"];
if (!isset($gottorrent))
autolink("Erreur"," ... Aucun torrent sélectionné !","&nbsp;<a href=torrents-details.php?id=$gottorrent>Retour sur la fiche du torrent!</a></div>");
//
if ((get_row_count("bookmarks", "WHERE userid=$CURUSER[id] AND torrentid = $gottorrent")) > 0)
   autolink("torrents-details.php?id=$gottorrent", "Torrent déjà mis en signet.");
#show_error_msg("Erreur","Torrent déjà mis en signet.",1);
   //
if ((get_row_count("torrents", "WHERE id = $gottorrent")) > 0) {
SQL_Query_exec("INSERT INTO bookmarks (userid, torrentid) VALUES ($CURUSER[id], $gottorrent)") or die(mysqli_error($GLOBALS["DBconnector"]));

stdhead("Bookmarks");
#begin_frame ("Avec succès !");
#echo "<div align=center><font color=red><font size=4><i>Torrent ajouté avec succes!!!</i></font></font>";
autolink("torrents-details.php?id=$gottorrent", "<center><div align=center><font color=red><font size=4><i>Torrent ajouté avec succes!!!</i></font></font>&nbsp;...Retour sur la fiche du torrent!</div></center>");
#echo "&nbsp;<a href=torrents-details.php?id=$gottorrent>Retour sur la fiche du torrent!</a></div>";
#end_frame();
stdfoot();
}
else show_error_msg("Erreur","ID introuvable",1);
?>

Last edited by spiritblue on 2021-12-07 23:01:36
2022-02-06 05:04:07
You cant use a float value on a LIMIT.

0.25 should be 0,25

row 0 (first row), 25 (next 25 rows)
2023-10-19 21:42:49
thanks you Botanicar 👍

It worked, but I no longer see my list ?

===============
Thanks STorrents2020 for your help 😉
bookmarks.rar
Download

Last edited by spiritblue on 2023-10-19 21:56:14
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: 8
  • Members: 0
  • Guests online: 8
  • Comments: 3
  • Messages: 1,728