Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 26th April 2016, 01:17
orichec1000 orichec1000 is offline
Member
 
Join Date: Oct 2015
Posts: 2
Default Arrangment of Torrents / Sql Query to sort Torrrents
Hello everyone,
I tried to sort Appz related torrents from database by calling table "category" but when i use sort by category using php it also mix up other torrents such as movies, Please guide me how can I sort torrents of only one category instead of all from table "category"...
Here is my php codes
PHP Code:
$orderby "ORDER BY torrents.category DESC";
$addparam "";
if (
$_GET["incldead"] == 2)
    
$wherea[] = "visible = 'yes'";
$res mysql_query("SELECT COUNT(*) FROM torrents $where") or die(mysql_error());
$row mysql_fetch_array($res,MYSQL_NUM);
$count $row[0];
if (
$count)
{
  
$pager pager($torrentsperpage$count"browse.php?" $addparam);
  
$query "SELECT torrents.id, torrents.category, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.type,  torrents.comments,torrents.numfiles,torrents.filename,torrents.owner,IF(torrents.nfo <> '', 1, 0) as nfoav," .
  
"categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = torrents.id LEFT JOIN users ON torrents.owner = users.id $where $orderby {$pager['limit']}";
  
$res mysql_query($query) or die(mysql_error()); 

Thanks
Reply With Quote
Reply

Tags
arrangment , query , sort , sql , torrents , torrrents

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 01:06. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.