connect_errno) { die("Unable to connect to the database. Please try again later."); } $sql = "SELECT id, url, description FROM thecraft_images.images where onGalleryPage = 1 ORDER BY id DESC"; $statement = $link->prepare($sql); if($statement === false) { die("hi " . $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->bind_result($imageID, $listingURL, $description); $listOfImages = ''; $counter = 0; $imageNumber = 0; $imageLinks = ''; while ($statement->fetch()) { if ($counter >= $startingElement && $counter < $lastElement) { $listOfImages .= "
$description