I am implementing pagination on my php script, pagination is already
working, the result is displayed as checkboxes for users to check their
choices. my prob is if i have more than 1 page, users should be able to
choose from all 4 pages,
one solution is creating a temporal table, which c
On Sun, Oct 19, 2008 at 5:38 PM, <[EMAIL PROTECTED]> wrote:
[...]
> First method is slower but more secure. Second is speediest but it can
> have more failures because are session vars or cookies. It depends of
> your control errors and also the visits profile.
I'm not sure what you're trying to
> I am implementing pagination on my php script, pagination is already
> working, the result is displayed as checkboxes for users to check their
> choices. my prob is if i have more than 1 page, users should be able to
> choose from all 4 pages,
one solution is creating a temporal table, which c
Hi,
I am implementing pagination on my php script, pagination is already
working, the result is displayed as checkboxes for users to check their
choices. my prob is if i have more than 1 page, users should be able to
choose from all 4 pages,
e.g. result is about 4 pages, user can choose up t
Thanks guys, I'll try all the documentation I and samples collected.
Thanks!
Unnawut Leepaisalsuwanna wrote:
> the part
>
> $page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']);
>
> i believe can help prevent sql injection... i rounded the $_GET['page'] as
> wel
the part
$page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']);
i believe can help prevent sql injection... i rounded the $_GET['page'] as well
in case someone tries to put in decimals and ruin the query
the $perpage is the number of rows you want to display
xkorakidis wrote:
>hm
I posted a couple of simple function in the examples section on
www.weberdev.com
http://www.weberdev.com/get_example-4092.html
http://www.weberdev.com/get_example-4093.html
bastien
From: xkorakidis <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] pagination example?
Dat
Thanks Raz,
it looks proffesional, I'll try to take the advantage of it!
Thanks a lot!
Christos Korakidis
Raz wrote:
> Try PEAR's Pager package - fairly straightforward to use:
> http://pear.php.net/package/Pager
--
PHP Database Mailing List (http://www.php.net/)
To unsub
hmmm,
it seems simple, althought I didn't yet understand what exactly takes
part in
$page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']);
it seems like a c expression : if page is not numeric page=1 else round
page?
How does the $perpage increase?
couldn't we use smth $page++ ?
Thanks.
Try PEAR's Pager package - fairly straightforward to use:
http://pear.php.net/package/Pager
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$perpage = 10;
$page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']);
$page = ($page-1) * $perpage;
$sql = 'SELECT * FROM `table` WHERE 1 LIMIT '. $page .', '. $perpage;
something like this?
xkorakidis wrote:
>Hi, I'm trying to find a simple example for pagination in php-mysql. I
>f
Hi, I'm trying to find a simple example for pagination in php-mysql. I
found smth in php classes but it seems too complex (3-4 files and things
not so simple). Is there any simple way to do that?
Thanks.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/
Add an identtiy column to the table, then select all records from the table
where the identity col is between the start and the start+number of rows to
show
Bastien
From: "Rui Cruz" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Pagination problems
The mssql_fetch_row works with an MS Access database?
Because I'm have the same problem while trying to paginate results. I always
read the whole results into an array an then I break them up using the
array.
This is a stupid and slow solution, but how could one overcome this?
""Pablo M. Riva
first~ may be you can change these:
$ssql = "select * from table ORDER by Name";
$rs = mssql_query($ssql,$conn);
$total_records = mssql_num_rows($rs);
to:
$ssql = "SELECT COUNT(*) AS TOTAL FROM TABLE";
$rs = mssql_squery($ssql,$conn);
$total_records = mssql_result("TOTAL");//may not this function,
Thanks Plabo, it worked perfectly.
And I want to apollogize with all the list for the receipt confirmation,
I completly forgot it.
Thanks again.
Pablo M. Rivas escribió:
upsss.. y forgot $counter++
$counter=0;
while ($row=mssql_fetch_row($rs)) {
if (($counter>=$start) and ($counter<($star
upsss.. y forgot $counter++
$counter=0;
while ($row=mssql_fetch_row($rs)) {
if (($counter>=$start) and ($counter<($start+ $Page_Size)) {
echo "";
//There you go: Show all fields, one to each cell
echo "" . implode("",$row) . "";
echo "\n";
}
$counter++;
}
--
Pablo M. Rivas. h
Hello Jenaro:
First off all (i'ts not exactly your question), but i think you don't
need to make this big array:
$my_array[] ="";
while ($row = mssql_fetch_object($rs)){
$my_array[]="$row->tId";
}
'cause you don't need it... you may directly do something like this:
$counter=0;
while ($row=
Hello everybody,
This is my first message to the list and as usual is to try to solve a
problem.
I am using PHP+IIS+SQLServer on windows platform (no choice at the
moment :(...)
Wel, I am trying to paginate some results this is the code:
$conn = mssql_connect("myserver", "myuser", "mypasswo
Try heading over to www.phpfreaks.com, they have a couple of
tutorials/examples on how to achieve this.
HTH
Graham.
On Thu, 16 Dec 2004 14:38:29 -0800, David Ziggy Lubowa
<[EMAIL PROTECTED]> wrote:
>
>
> Hey guys,
>
> I am working on an internal db and i have a script[below] which does some
here is a paging class that i created using PHP 5 and the singleton
pattern, now because i used the singleton pattern you can only have
one paging per html page, however that is easy to edit, you could also
easilly convert this to php 4
if you would like me to meke this so that you can have more t
Hi you all,
here is how I am doing in a veery big class of mine.. Course that
uses class's specific terms, but it's very easy to understand.
=
/*
* Fetch paginated results
*
have a look at the PEAR Pager class.
very useful.
_
- Original Message -
From: "David Ziggy Lubowa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 16 December 2004 23:38
Subject: [PHP-DB] Pagination
>
>
> Hey guys,
>
>
Hey guys,
I am working on an internal db and i have a script[below] which does some
searching for me, now i am no expert in php but atleast i can always read up,
i want to add some kind of pagination because just incase i search for
somethign in particular i dont want it to display 100 ent
Newer versions of php user $_POST and $_GET to access form variables...try
this
if([EMAIL PROTECTED]'start']) $start = 0;
bastien
From: "Valerie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [PHP-DB] pagination
Date: Sun, 5 Dec 2004 10:19:03 -0500
It sho
It shows next and the first 10 records but will not bring up the next 10
when next is pressed.
1){
echo "Previous";
}
if($numrows > ($start + 10)){
echo "Next";
}
$query='SELECT * '
. ' FROM `Wellington` '
. ' WHERE`location`="Hills" ORDER BY `LotNo` ASC L
It shows next and the first 10 records but will not bring up the next 10
when next is pressed.
$result2 = mysql_query($query2);
$row2 = mysql_fetch_array($result2);
$numrows = $row2['count'];
if($start > 1){
echo "Previous";
}
if($numrows > ($start + 10)){
echo "Next";
}
$query='SELECT
Jason, thank you so much...it works!! ... I love this community.
Andrés
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> On Sunday 13 July 2003 06:17, Andres wrote:
>
> > I have a MySQL database full with authors and titles. I made a script
that
> > searchs a specif
On Sunday 13 July 2003 06:17, Andres wrote:
> I have a MySQL database full with authors and titles. I made a script that
> searchs a specific author and return the all his books titles, but I need
> it show the results from 10 to 10. I tried with LIMIT and it return just
> fine the first 10 but wh
Hi all,
I have a MySQL database full with authors and titles. I made a script that
searchs a specific author and return the all his books titles, but I need it
show the results from 10 to 10. I tried with LIMIT and it return just fine
the first 10 but when I click the next 10 button it show me oth
30 matches
Mail list logo