i googled. but everywhere i found the pagination for rows.
here
<?php
// Create MySQL Query String
$strqry = “SELECT id from MyTable”;
$query = mysql_query($strqry) or die("MySQL Error: <br /> {$strqry} <br />", mysql_error());
// Get number of rows returned
$TOTALROWS = mysql_num_rows();
// Figure out how many pages there should be based on your $LIMIT
$NumOfPages = $TOTALROWS / $LIMIT;
// This is for your MySQL Query to limit the entries per page
$LimitValue = $page * $LIMIT – ($LIMIT);
?>
but in my part it pull data from a id by using url variable link is here
it pull data from row/id 2
i am not understanding how can i manage it.
p.s: sorry if iam a stupid but iam very eager to know
From what I understand you as saying is you want to paginate across text data that you’re retrieving. So I’m going to ask you to figure out Step #1 from my plan above. How much data do you want to show?
by googling All the tutorials I’ve found on pagination always refer to paginating multiple rows out of a database. Like displaying 5 rows on each page. But I’m trying to paginate an article that is being stored in one row of the table.
my table name is “page”
in the table “page” there is 4 rows
id | title | meta_description| meta_keywords |article
1 | title1 | meta 1| meta kewords |articles text1 bla blabla
2 | title2 | meta 2| meta kewords |articles text2 bla blabla
3 | title3 | meta 3| meta kewords |articles text3 bla blabla
4 | title4 | meta 4| meta kewords |articles text4 bla blabla
so in id=1 in the article text there is a article which almost 10 page size. so i need pagination for this article
Sounds like you need to rethink the way your storing the data. Tossing everything in a single column is not going to make anything easy. That said the only way you could really achieve what you want with your current schema is to use some regex magic but that is just horrible way to do in the first place. Rethink the schema properly isolating pieces of info into separate tables and this will be much simpler and reliable.
You need a concrete definition of a page. Only then can it be translated to programmatic logic.
Edit: One way to achieve your goals with ease would be to have people set a marker where a page ends and another begins. Than you would actually have a concrete definition.
That is what I imagined, insert, say, a <hr /> where you want the “page” to naturally break, that way you also have the option of showing the whole article.
Ideally you would insert that <hr /> as the article is written, but to be honest if you have this kind of control you may as well create the pages as separate entries in the database.
[I][B]Any place you want a page you would just put (in your article), “{page}” (or whatever you want to use as the page delimiter).
Then when you display the page, you will explode the article by the delimiter (“{page}”). This will create an array of pages for the number of delimiters you used.
Then, the method of generating the page links is the same as other pagination tutorial[/B][/I]