Code:<?php $episode = $_REQUEST['episode']; $season = $_REQUEST['season']; if ($season) { include_once ('boondocksconnect.php'); if ($season == 1) { if (!$episode) { $seasoninfo="SELECT * from bdseason1"; $seasoninfo2=mysql_query($seasoninfo) or die("could not select seasons from the boondocks."); echo "<div id='box'><div id='title'><div class='entry'> <p>Welcome to The Boondocks Season 1! Enjoy watching the boondocks online for free.</p> <p><strong><span style='font-size: large;'>Season 1</span></strong></p><table><tbody>"; while($seasoninfo3=mysql_fetch_array($seasoninfo2)) { $id = $seasoninfo3['id']; $link = $seasoninfo3['link']; $image = $seasoninfo3['image']; $name = $seasoninfo3 ['name']; $desc = $seasoninfo3 ['desc']; echo "<tr> <td><a href='$link'><img style='margin: 0px 10px 10px 10px;' src='$image' width='250' height='188' align='left' /><span style='font-size: small;'><strong>$name</strong></span></a></p><p>$desc</p></td> </tr>"; } echo "</tbody></table></div></div></div>"; } } if ($season == 2) { $seasoninfo="SELECT * from bdseason2"; $seasoninfo2=mysql_query($seasoninfo) or die("could not select seasons from the boondocks."); echo "<div id='box'><div id='title'><div class='entry'> <p>Welcome to The Boondocks Season 2! Enjoy watching the boondocks online for free.</p> <p><strong><span style='font-size: large;'>Season 2</span></strong></p><table><tbody>"; while($seasoninfo3=mysql_fetch_array($seasoninfo2)) { $id = $seasoninfo3['id']; $link = $seasoninfo3['link']; $image = $seasoninfo3['image']; $name = $seasoninfo3 ['name']; $desc = $seasoninfo3 ['desc']; echo "<tr> <td><a href='$link'><img style='margin: 0px 10px 10px 10px;' src='$image' width='250' height='188' align='left' /><span style='font-size: small;'><strong>$name</strong></span></a></p><p>$desc</p></td> </tr>"; } echo "</tbody></table></div></div></div>"; } if ($season == 3) { $seasoninfo="SELECT * from bdseason3"; $seasoninfo2=mysql_query($seasoninfo) or die("could not select seasons from the boondocks."); echo "<div id='box'><div id='title'><div class='entry'> <p>Welcome to The Boondocks Season 3! Enjoy watching the boondocks online for free.</p> <p><strong><span style='font-size: large;'>Season 3</span></strong></p><table><tbody>"; while($seasoninfo3=mysql_fetch_array($seasoninfo2)) { $id = $seasoninfo3['id']; $link = $seasoninfo3['link']; $image = $seasoninfo3['image']; $name = $seasoninfo3 ['name']; $desc = $seasoninfo3 ['desc']; echo "<tr> <td><a href='$link'><img style='margin: 0px 10px 10px 10px;' src='$image' width='250' height='188' align='left' /><span style='font-size: small;'><strong>$name</strong></span></a></p><p>$desc</p></td> </tr>"; } echo "</tbody></table></div></div></div>"; } } if ($episode) { require('connectepisodes.php'); $episodeinfo = "SELECT * from boondocks where id=$id"; $episodeinfo2 = mysql_query($episodeinfo) or die ("could not select episode from boondocks."); while($episodeinfo3 = mysql_fetch_array($episodeinfo2)) { require('boondockscomment.php'); require('input.php'); $table = $episodeinfo3['id']; $previous = $episodeinfo3['id']-1; $next = $episodeinfo3['id']+1; $name = $episodeinfo3['name']; $nextseason = 1; $prevseason = 1; $video = $episodeinfo3['video']; if ($next > 15 && $next < 30) { $nextseason = 2; } if ($next > 30) { $nextseason = 3; } if ($previous > 15 && $previous < 30) { $prevseason = 2; } if ($previous > 30) { $prevseason = 3; } echo "<div id='box'><div id='title'><div class='entry'>"; if ($next < 45) { echo "<a href='boondocks.php?season=$nextseason&episode=$next'>Next Episode</a>"; } echo "<p><strong><span style='font-size: large;'>$name</span></strong></p> <table><tr><td>$video"; if ($previous > 1) { echo "<a href='boondocks.php?season=$prevseason&episode=$previous'>Previous Episode</a>"; } echo "<script src='http://connect.facebook.net/en_US/all.js#xfbml=1'></script><fb:like show_faces='true' width='450'></fb:like> <a expr:share_url='data:post.url' href='http://www.facebook.com/sharer.php' name='fb_share' type='button_count'>Share on Facebook</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'></script> </td></tr>"; } } if (!$season) { require('boondocksfeat.php'); } ?>
the queries are working but I need some help with this :
when i click on the season, the season query works, when i click on the episode I have 2 queries how can I stop the first one and let only the second one run please help.


Reply With Quote
Bookmarks