On Friday 20 December 2002 23:16, Steve Dodkins wrote:
Has anyone got some code that will correctly display the next 10 line of a
table with prev and next working?
Or point me in the right direction for help?
Search the archives. This kind of question gets asked (and sometimes answered)
every
check out php.weblogs.com
ADODB does this for you.
=C=
*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*
-Original Message-
From: Steve Dodkins [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Next/Prev 10 lines
Has
First you have to find how many rows would make your SELECT query in
case you would not use LIMIT from, num.
Then you have to divide this by number of rows per page and use it
in the SELECT query.
Then to your number of pages displayed on your page you add links to
the first number of the LIMIT
I did something like this with a photo gallery I made. The approach I took is
the execute a query, get the number of rows, and divide that number by how ever
many records I wanted on that page. Then that would give me the number of total
pages I would have for my navigational links at the
How about appending LIMIT _GET[startrow],5 to the end of your query.
The first parameter to LIMIT is the start position and the second is
the number of rows to return.
Does this help, or am I misunderstanding your question?
Mark
Lucas Novæ Matrix wrote:
Hello,
I am trying to create a
That would actually work for just getting a certain number of records from a
query, but you would have to execute another query to figure out the navigational
links he said he wants on the bottom...like google has, 1 2 3 4 5 . So,
when I attacked it I figured one query is better then two even
That would actually work for just getting a certain number of records
from
a
query, but you would have to execute another query to figure out the
navigational
links he said he wants on the bottom...like google has, 1 2 3 4 5
.
So,
when I attacked it I figured one query is better then two
-Original Message-
From: Smita Manohar [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 26, 2002 8:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] next prev links for search result
hiii..
i want page no. and next prev links while displaying search
result. the
script which im
The simple answer might be:
SELECT member.*
FROM `member`
WHERE DAYOFYEAR(member_dob) = DAYOFYEAR(CURDATE())
ORDER BY member_dob DESC LIMIT 1
Seems to work for me. The problem is that it wouldn't support members that
have a birthday on the same day :) To solve that I would select the next
On Fri, 8 Mar 2002, Robert V. Zwink wrote:
The simple answer might be:
SELECT member.*
FROM `member`
WHERE DAYOFYEAR(member_dob) = DAYOFYEAR(CURDATE())
ORDER BY member_dob DESC LIMIT 1
Seems to work for me.
Not for me. I think it should be ordered like this:
ORDER BY
Use sessions. (session_start() and session_register()), and at the start of the test
save row_ids(question_ids) in arrray which you
make with session_register a session variable. On other pages you do session_start()
and after that you have access to the array.
Regards,
Andrey Hristov
IcyGEN
Pass the current question number in a parameter to the next page in the URL.
In the following, the PHP variable would track your current page:
print A href=\myform.php3?page=$page\Next/A;
-
then, in myform.php3:
?php
$page++;
display the question for this
rough and readysomething like this should work...
$pagesize = 20;
$page = $page ? $page : 1;
$pages = ceil(mysql_num_rows( $results ) / $pagesize );
mysql_data_seek( $results, ($page - 1) * $pagesize );
while( ($row = mysql_fetch_object( $results )) ( $counter++
$pagesize) )
{
//
Keep a counter of the rows you have fetched. so when you want to go back
call mysql_data_seek ($Result, Counter-1);
then mysql_fetch
and you've got the previous row.
Lennin Arriola
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
iginal-
De: Andrew Hill [EMAIL PROTECTED]
Para: Dreamvale [EMAIL PROTECTED]; [EMAIL PROTECTED]
Enviada em: quinta-feira, 22 de fevereiro de 2001 14:10
Assunto: RE: [PHP-DB] next previous record
You want to use Cursors, and I don't believe MySQL supports cursors yet,
15 matches
Mail list logo