Im not very good at mysql query thatswhy I ask here for a little help.
I use this query to select an anime tvshow
$getMovieCmd = "SELECT id,name,hoster,season,episode FROM topmovies.movies
WHERE name = '".mysql_real_escape_string($_GET['name'])."' ";
But I dont want to show all animes with only the same name. I want only to show those anime with the same name, same season and same episode.
Example: tvshow: Naruto / Season: 1 and 2 / Episode: 1,2,3,4,5,6,7,8,9,10
I only want to show naruto with season 1 and ALL hoster which has episode 1.
Picture so you see what I want to do http://s14.directupload.net/images/130819/g6bz3ef8.jpg (Staffel = Season)
As you see on the picture the episode is selected. Now I want to make, that all different hosters with that episode will be selected.
Hope you understand my shitty english :/
Im searching for a query like this
$getMovieCmd = "SELECT id,name,hoster FROM topmovies.movies
WHERE name = '".mysql_real_escape_string($_GET['name'])."'
IN (SELECT season FROM topmovies.movies WHERE name = '".mysql_real_escape_string($_GET['name'])."') AS season
IN (SELECT episode FROM topmovies.movies WHERE name = '".mysql_real_escape_string($_GET['name'])."') AS episode
";
If I understand you correctly what you are looking for is:
$getMovieCmd = "SELECT id,name,hoster,season,episode FROM topmovies.movies
WHERE name = '".mysql_real_escape_string($_GET['name'])."'
AND episode = '".mysql_real_escape_string($_GET['episode'])."'
AND season = '".mysql_real_escape_string($_GET['season'])."'";
And season=$_GET['season'] and episode=$_GET['episode']
That is if you have them in $_GET
you need to add more parameters to your query
$getMovieCmd = "SELECT id,name,hoster,season,episode FROM topmovies.movies
WHERE name = '".mysql_real_escape_string($_GET['name'])."' AND season = '".mysql_real_escape_string($_GET['name'])."' AND episode= '".mysql_real_escape_string($_GET['episode'])."' ";