connect_errno) { die("Unable to connect to the database. Please try again later."); } $sql = "SELECT id, url, description FROM thecraft_images.images where onPublicityPage = 1 ORDER BY id DESC"; $statement = $link->prepare($sql); if($statement === false) { die("error " . $link->error); } // $statement->bind_param('ss',$personUserID , $pageNameItself); $statement->execute(); if (isset($statement->error) && strlen($statement->error) > 0) { die("SQL failed, please try again later"); } $statement->store_result(); $statement->bind_result($imageID, $listingURL, $description); $listOfImages = ''; $imageLinks = ''; $counter = 0; $imageNumber = 0; while ($statement->fetch()) { if ($counter >= $startingElement && $counter < $lastElement) { $listOfImages .= "
"; $imageNumber++; } $counter++; $totalPages = ($counter/$numberOfImagesPerPage); } if (strlen($listOfImages) < 5) { $listOfImages = "There are no more images to display