ERROR!

No joke was requested, please go back to the homepage and start again.
"; } else { $vote = $_REQUEST['vote']; if($vote) { $lookup_field = "votestar".$vote; $get_values = mysql_query("SELECT votestar1, votestar2, votestar3, votestar4, votestar5 FROM jokes WHERE id = ".$j." LIMIT 1"); $votestar1 = mysql_result($get_values, 0, votestar1); $votestar2 = mysql_result($get_values, 0, votestar2); $votestar3 = mysql_result($get_values, 0, votestar3); $votestar4 = mysql_result($get_values, 0, votestar4); $votestar5 = mysql_result($get_values, 0, votestar5); if($vote == 1) $votestar1 = $votestar1+1; elseif($vote == 2) $votestar2 = $votestar2+1; elseif($vote == 3) $votestar3 = $votestar3+1; elseif($vote == 4) $votestar4 = $votestar4+1; elseif($vote == 5) $votestar5 = $votestar5+1; $total = ($votestar1 * 1)+($votestar2 * 2)+($votestar3 * 3)+($votestar4 * 4)+($votestar5 * 5); $total = $total/($votestar1+$votestar2+$votestar3+$votestar4+$votestar5); $update_joke = mysql_query("UPDATE jokes SET ".$lookup_field." = ".$$lookup_field.", votestartotal = ".$total." WHERE id = ".$j." LIMIT 1"); } $jokeqry = mysql_query("SELECT * FROM jokes WHERE id = ".$j." LIMIT 1"); if($jokeqry) { $category = mysql_result($jokeqry, 0, category); $joke = stripslashes(mysql_result($jokeqry, 0, joke)); $dateadded = mysql_result($jokeqry, 0, dateadded); $dateadded = substr($dateadded, 8, 2)."/".substr($dateadded, 5, 2)."/".substr($dateadded, 0, 4); $votestartotal = mysql_result($jokeqry, 0, votestartotal); $views = mysql_result($jokeqry, 0, views); $newviews = $views+1; $update = mysql_query("UPDATE jokes SET views = ".$newviews." WHERE id = ".$j." LIMIT 1"); } else die("ERROR LOOKING UP JOKE"); $ptitle = substr($joke, 0, 50)."... joke"; $meta_keys = str_replace(" ", ", ", substr($joke, 0, 50)).", search, jokes, funny, laugher, joke, gag, laughing"; $meta_desc = substr($joke, 0, 50)."... joke"; if($r == 1) $selected = "RANDOM"; else $selected = "VIEW"; include("header.php"); ?> "; echo ""; echo ""; if(number_format($votestartotal, 0) == 0) $rating = "not yet rated"; else $rating = number_format($votestartotal, 0)." stars"; echo ""; echo ""; echo ""; echo ""; echo ""; $this_url = $site_path."view-".$j."-".trim(substr(urlconvert($joke), 0, 50)).".html"; $this_title = trim(substr($joke, 0, 50)); echo ""; echo "
"; echo "
"; if($r == 1) echo "Random"; else echo "Viewing"; echo " Joke:

Category:".$category."
  
Rating:".$rating.""; if(!$vote) echo "     "; echo "
Views:".$newviews."
 
Joke:".$joke."
 
 Add to del.icio.us    Digg this    Reddit
"; ?>



More :

"; $tracker = 1; while($row = mysql_fetch_array($temp)) { echo "".$tracker.".   Rating:  ".$row[votestartotal]." stars"; echo "".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; $tracker++; } echo "
"; ?>