PHP Code:
<?php
$episode = $_REQUEST['episode'];
$season = $_REQUEST['season'];
if ($season)
{
include_once ('connectseasons.php');
if ($season == 1)
{
$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('connect.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('comment.php');
$table = $episodeinfo3['table'];
$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 ($previous > 1)
{
echo "<a href='boondocks.php?season=$prevseason&episode=$previous'>Previous Episode</a>";
}
echo "<p><strong><span style='font-size: large;'>$name</span></strong></p>";
if ($next < 45)
{
echo "<a href='boondocks.php?season=$nextseason&episode=$next'>Next Episode</a>";
}
echo "<table><tr><td>$video";
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>
<form action='comment.php' method='post'>
<table>
<input type='hidden' name='episode' value='$table' />
<tr><td colspan ='2'><h3>Add a Comment</h3></td></tr>
<tr><td>Name:</td><td><input type='text' name='name' /></td></tr>
<tr><td>Location:</td><td><input type='text' name='location' /></td></tr>
<tr><td colspan ='2'>Comment:</td></tr>
<tr><td colspan ='2'><textarea name='comment' rows='10' cols='60' ></textarea></td></tr>
<tr><td colspan ='2'><input type='submit' name='submit' value='comment' /></td></tr>
</table>
</form>";
require('output.php');
}
}
the first query is working, when I query the the second thing (which results from a query) it also works, but is there any way I could stop the first query after starting the first query?
skela