Search the Community
Showing results for tags 'not found'.
-
What it is doing: Right now it is taking the last known team members ($allteammembers) on all the rest of the results that do not have any team members. - So it should show nothing. What I want it to do: To show nothing for $allteammembers when there is no data found. - Like the way I think I have it coded. The Full Code Going Through Database: if ($stmt = $mysqli->prepare("SELECT title, caption, category, image, placement, teammember1, teammember2, teammember3, otherpeople, downloads, views FROM photogallery WHERE year = ? AND timeofday = ? AND status = 1 ORDER BY category, placement")) { $stmt->bind_param('is', $year, $timeofday); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($title, $caption, $category, $image, $placement, $teammember1, $teammember2, $teammember3, $otherpeople, $downloads, $views); while($stmt->fetch()) { if ((!empty($placement))) { $stmt2 = $mysqli->prepare("SELECT boat, teammember1, teammember2, teammember3, channel, flathead, blue, total, bigfish, totalweight FROM tourneyresults WHERE year = ? AND timeofday = ? AND placement = ?"); $stmt2->bind_param('isi', $year, $timeofday, $placement); $stmt2->execute(); $stmt2->store_result(); $stmt2->bind_result($boat, $member1, $member2, $member3, $channels, $flatheads, $blue, $total, $bigfish, $weight); $stmt2->fetch(); $stmt2->close(); $link1 = addplus($member1); $link2 = addplus($member2); $link3 = addplus($member3); if ((!empty($member1)) && (!empty($link1))) {$member1 = "<a href='$mainurl/fisher/$link1'>$member1</a>";} if ((!empty($member2)) && (!empty($link2))) {$member2 = "and <a href='$mainurl/fisher/$link2'>$member2</a>";} if ((!empty($member3)) && (!empty($link3))) {$member3 = "and <a href='$mainurl/fisher/$link3'>$member3</a>";} if ($boat) {$boat2 = "~ Boat #$boat";} else {$boat2 = "";} if ($channels) {$channels2 = "$channels Channel(s)";} else {$channels2 = "";} if ($flatheads) {$flatheads2 = " | $flatheads Flathead(s)";} else {$flatheads2 = "";} if ($blue) {$blue2 = " | $blue Blue(s)";} else {$blue2 = "";} if ((!empty($member1)) && (!empty($link1))) {$allteammembers = "<b>Team Members: </b>$member1 $member2 $member3 $boat2<br><span style=\"padding-left: 20px\">Caught: $channels2$flatheads2$blue2</span><br><br>";} else {$allteammembers = "";} } $link5 = addplus($teammember1); $link6 = addplus($teammember2); $link7 = addplus($teammember3); if ((!empty($teammember1)) && (!empty($link5))) {$teammember1 = "<a href='$mainurl/fisher/$link5'>$teammember1</a>";} if (!empty($teammember2) && !empty($link6)) {$teammember2 = "and <a href='$mainurl/fisher/$link6'>$teammember2</a>";} if (!empty($teammember3) && !empty($link7)) {$teammember3 = "and <a href='$mainurl/fisher/$link7'>$teammember3</a>";} if ((!empty($teammember1)) && (!empty($link5))) {$teammemberspictured = "<b>Team Members Pictured: </b>$teammember1 $teammember2 $teammember3<br>";} else {$teammemberspictured = "";} if ((!empty($otherpeople)) && (((!empty($teammember1)) && (!empty($link5))) || ((!empty($member1)) && (!empty($link1))))) {$otherpeople2 = "<b>Other People in This Photo:</b> $otherpeople<br>";} if (!empty($otherpeople) && ((empty($teammember1)) && (empty($link5))) && ((empty($member1)) && (empty($link1)))) {$otherpeople2 = "<b>People in This Photo:</b> $otherpeople<br>";} if (($category == "0") || (empty($category))) {$category2 = "No Category";} if (($category == "1")) {$category2 = "First Place Winner";} if (($category == "2")) {$category2 = "2nd-5th Place Winners";} if (($category == "3")) {$category2 = "6th-12th Place Winners";} if (($category == "4")) {$category2 = "13th-20th Place Winners";} if (($category == "5")) {$category2 = "13th-24th Place Winners";} if (($category == "6")) {$category2 = "Big Fish Winners";} if (($category == "7")) {$category2 = "Take Off";} if (($category == "8")) {$category2 = "Weigh In";} if (($category == "9")) {$category2 = "Scoreboard";} if (($category == "10")) {$category2 = "Prizes from Drawing";} if (($category == "11")) {$category2 = "Kids Prizes and Face Painting";} if (($category == "12")) {$category2 = "Morning Meeting";} if (($category == "13")) {$category2 = "Sign Up";} if (($category == "14")) {$category2 = "Spectators";} if (($category == "15")) {$category2 = "Misc.";} if (($category == "16")) {$category2 = "Extra Photos";} if ($timeofday == "night") {$subfolder = "NightTourney";} else {$subfolder = "year";} ECHO<<<END <div class="gallery" id="container"> <div id="left"> <img src="$mainurl/images/$subfolder/$year/$image"> </div> <div id="bottom"> $category2 | <a href="$mainurl/images/year/$year/$image" class='links'>Download Image</a> | $downloads downloads | $views views | Report Error | Add A Comment </div> <div id="right"> <h3>$title</h3> $allteammembers $teammemberspictured $otherpeople2 <p>$caption</p> </div> </div> END; } $stmt->close(); } Snippet Not Working Correctly: if ((!empty($member1)) && (!empty($link1))) {$allteammembers = "<b>Team Members: </b>$member1 $member2 $member3 $boat2<br><span style=\"padding-left: 20px\">Caught: $channels2$flatheads2$blue2</span><br><br>";} else {$allteammembers = "";} I would like to know how to fix it and why it is doing it exactly? All my ideas failed. :/