|
#1
|
|||
|
|||
Movies show all years
Hello!
First I wanted to ask in chat but then I decided that this might be easier and faster. So I got this code in one part of my website: Code:
$current_year = '2013'; $where = $current_year; //Default if($_GET["year"] == '00'){ $where = '2000'; } if($_GET["year"] == '01'){ $where = '2001'; } if($_GET["year"] == '02'){ $where = '2002'; } if($_GET["year"] == '03'){ $where = '2003'; } if($_GET["year"] == '04'){ $where = '2004'; } if($_GET["year"] == '05'){ $where = '2005'; } if($_GET["year"] == '06'){ $where = '2006'; } if($_GET["year"] == '07'){ $where = '2007'; } if($_GET["year"] == '08'){ $where = '2008'; } if($_GET["year"] == '09'){ $where = '2009'; } if($_GET["year"] == '10'){ $where = '2010'; } if($_GET["year"] == '11'){ $where = '2011'; } if($_GET["year"] == '12'){ $where = '2012'; } if($_GET["year"] == '13'){ $where = '2013'; } Code:
<select name=\"year\"> <option value=\"00\">2000</option> <option value=\"01\">2001</option> <option value=\"02\">2002</option> <option value=\"03\">2003</option> <option value=\"04\">2004</option> <option value=\"05\">2005</option> <option value=\"06\">2006</option> <option value=\"07\">2007</option> <option value=\"08\">2008</option> <option value=\"09\">2009</option> <option value=\"10\">2010</option> <option value=\"11\">2011</option> <option value=\"12\">2012</option> <option value=\"13\">2013</option> </select> <input class=\"btn\" type=\"submit\" value=\"Submit\" /> Edit Forgot to mention that it would be nice to see them sorted by year (2013 first, then 2012, 2011 etc.) when showing all. I added query below: Code:
$res = mysql_query("SELECT premieres.id, premieres.name, premieres.year, premieres.genre, premieres.descr, premieres.imdb, premieres.imdb_rating, premieres.uploaded, premieres.url, premieres.poster, premieres.owner, premieres.ori_name, users.username, users.class FROM premieres LEFT JOIN users ON premieres.owner = users.id WHERE year = '$where' ORDER BY id DESC $limit"); Code:
ORDER BY year Last edited by mat22; 28th March 2013 at 00:12. |
#2
|
||||
|
||||
that query you have well only show torrents for ONE Year
this well help your code a little PHP Code:
PHP Code:
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#3
|
|||
|
|||
I know it shows only one year. The thing is - I want to make it show one year but if user chooses - all years. Like where I have options for years I want an option "All" and then get all movies to show up when they choose it. I can make it show all years by just removing or commenting out all parts about year. I added full php file as an attachment so you can see what I have there. Problem isn't that it's showing only one year - problem is that I can't get it to show all years (and when I do that one year thingy isn't working).
P.S. Maybe I didn't understand your idea cuz sometimes I'm stupid like that. Sorry, if it's like talking to a brick wall (and I often feel it is).:D |
#4
|
||||
|
||||
Here let me do it for you
PHP Code:
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#5
|
|||
|
|||
Yeah this gives me error.
|
#6
|
||||
|
||||
try this
PHP Code:
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#7
|
|||
|
|||
Now it's showing that there isn't any movie added.
|
#8
|
||||
|
||||
In the data base how dose it have the years listed?
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#9
|
|||
|
|||
Full year. 2012, 2013, 2000 etc.
|
#10
|
||||
|
||||
sory missed the second query
PHP Code:
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
The Following User Says Thank You to joeroberts For This Useful Post: | ||
mat22 (28th March 2013)
|
Tags |
movies , show , years |
|
|