Jacques1 Posted August 5, 2016 Share Posted August 5, 2016 What does this have to do with any of the suggestions? We've offered two possible solutions, you've instead picked an approach which makes no sense. Now what? 1 Quote Link to comment https://forums.phpfreaks.com/topic/301761-back-to-pdo-and-get-strange-error-on-online-host-not-on-wamp/page/2/#findComment-1535666 Share on other sites More sharing options...
lovephp Posted August 5, 2016 Author Share Posted August 5, 2016 What does this have to do with any of the suggestions? We've offered two possible solutions, you've instead picked an approach which makes no sense. Now what? sorry now i get the point Quote Link to comment https://forums.phpfreaks.com/topic/301761-back-to-pdo-and-get-strange-error-on-online-host-not-on-wamp/page/2/#findComment-1535667 Share on other sites More sharing options...
lovephp Posted August 5, 2016 Author Share Posted August 5, 2016 (edited) and this just showing why this also wont work it would show 1 record but the next page is not showing any record $offset = ($page - 1) * $per_page; $start = $offset + 1; $end = max(($offset + $per_page), $total); $query = "SELECT * FROM applied WHERE memberID = :memberID ORDER BY id DESC LIMIT :per_page OFFSET :offset"; $stmt = $db->prepare($query); $stmt->bindParam(':per_page', $end, PDO::PARAM_INT); $stmt->bindParam(':offset', $start, PDO::PARAM_INT); $stmt->bindParam(':memberID', $uid, PDO::PARAM_INT); $stmt->execute(); Edited August 5, 2016 by lovephp Quote Link to comment https://forums.phpfreaks.com/topic/301761-back-to-pdo-and-get-strange-error-on-online-host-not-on-wamp/page/2/#findComment-1535668 Share on other sites More sharing options...
lovephp Posted August 5, 2016 Author Share Posted August 5, 2016 and if i do $offset = abs(($page - 1) * $per_page); it works too Quote Link to comment https://forums.phpfreaks.com/topic/301761-back-to-pdo-and-get-strange-error-on-online-host-not-on-wamp/page/2/#findComment-1535671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.