Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Arrangment of Torrents / Sql Query to sort Torrrents (http://www.bvlist.com/showthread.php?t=10821)

orichec1000 26th April 2016 01:17

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


All times are GMT +2. The time now is 12:37.

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