Jump to content

Recommended Posts

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?

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.

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.

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.