maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 Strider64 thank you. i don't know pdo Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590506 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 ginerjm I got all the codes. this error pops up. Parse error: syntax error, unexpected token "{" in C:\xampp\htdocs\blog\orta.php on line 42 line 42 : { line41: elseif(isset($_POST['sayfa']) This is the first time I see the use of input tag in pagination construction. Is this how it should be used? Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590507 Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 16 minutes ago, maviyazilim said: barand. I got the above below. I deleted the query. this is the result. Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, string given in C:\xampp\htdocs\blog\orta.php:40 Stack trace: #0 C:\xampp\htdocs\blog\orta.php(40): mysqli_fetch_assoc('SELECT * FROM i...') #1 C:\xampp\htdocs\blog\index.php(4): include('C:\\xampp\\htdocs...') #2 {main} thrown in C:\xampp\htdocs\blog\orta.php on line 40 line 40 : while($goster=mysqli_fetch_assoc($sorgu)) { You old query stored its results in $sorgu. Your new paginated query stores its results in $result. You need to adjust the code accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590509 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 Barand. problem solved. but I added content for trial purposes. to see if there will be 3 in storage. Substr does not work in the content I added recently. does not shorten. what could cause this? Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590510 Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 17 minutes ago, maviyazilim said: This is the first time I see the use of input tag in pagination construction. Is this how it should be used? It's one way. IMO< Your original use of <a>...</a> links is probably more common. You can always style the links to resemble buttons. Also, as all you are doing is GETting a new page of data, the convention is to use GET and not POST method. Use POST when the form action causes change - such as logging in or updating a database. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590511 Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 1 minute ago, maviyazilim said: what could cause this? I haven't a clue. Imagine I am not psychic and cannot see your screen or your current code. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590512 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 Barand. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590514 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 when I add it later, the substr doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590515 Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 3 minutes ago, maviyazilim said: when I add it later, the substr doesn't work. What substr? How does that image show your current code? I gave it a second try... enough is enough. Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590517 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 Barand. echo substr($goster['yazi'],0,300); shortens the old 16 content. it does not make abbreviations for the 5 contents I added later. it needs to publish the first 300 characters of the post. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590518 Share on other sites More sharing options...
ginerjm Posted September 29, 2021 Share Posted September 29, 2021 I left out a trailing parentheses Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590519 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 ginerjm. thanks. problem solved. Barand and ginerjm. thank you both so much Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590520 Share on other sites More sharing options...
ginerjm Posted September 29, 2021 Share Posted September 29, 2021 I hope you read thru each of our examples and learn from them. You have a long ways to go, so here's a good start. PS - you should learn how to use PDO instead of MysqlI Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590521 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 ginerjm If I manage to learn mysqli, I will learn pdo. thanks for advice. I've read over 20 video lessons for the simplest pagination at the moment. I've been dealing with it for a week or more. I just now solved it. I'm just trying to learn because I have interest and curiosity. I did not receive any school or training related to software. The fact that it was so difficult and challenging for a pagination made me very hard. If I manage to learn php, I try to learn pdo. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590522 Share on other sites More sharing options...
ginerjm Posted September 29, 2021 Share Posted September 29, 2021 For someone just starting out you chose a difficult task. Learning about how php works and the many functions to use is quite enough. As for learning Mysqli first - IMHO you are better off stopping that and moving to PDO. A much better interface and IMO a much simpler one. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590524 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 ginerjm google translate did not translate. google translate did not translate. What is IMHO What is IMO Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590526 Share on other sites More sharing options...
Barand Posted September 29, 2021 Share Posted September 29, 2021 (edited) In my (humble) opinion. I agree wholeheartedly with the above opinions on PDO Edited September 29, 2021 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590529 Share on other sites More sharing options...
ginerjm Posted September 29, 2021 Share Posted September 29, 2021 "In My Humble Opinion" and "In My Opinion" Sorry Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590530 Share on other sites More sharing options...
maviyazilim Posted September 29, 2021 Author Share Posted September 29, 2021 ginerjm thank you. Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590542 Share on other sites More sharing options...
ginerjm Posted September 30, 2021 Share Posted September 30, 2021 Hope you learn a lot from our efforts to help you. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/313819-paging-is-not-happening/page/3/#findComment-1590544 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.