RE: [PHP] Displaying data from db
| From: | Rick Emery | Date: | Fri, 22 Mar 2002 15:23:50 +0000 |
| Subject: | RE: [PHP] Displaying data from db | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-89696@lists.php.net to get a copy of this message | ||
> First what would be the best solution to take the records from the
> database and display like 10 results per page?
Check the list archives and php.net. There are many examples of this
functionality
> Another question, the same records from the database, but say I want to
> sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.......... etc.
> And if I click 'a' I only get records with name starting with A. Is this
> possible?
yes, it's possible. Use a drop-down list, radio buttons, or hyper-links
mysql: SELECT * FROM mytable WHERE mydata LIKE "$alpha%"
this assumes $alpha contains the single character you are searching for
-----Original Message-----
From: Vlad Kulchitski [mailto:vlad@alidaconnection.com]
Sent: Friday, March 22, 2002 9:25 AM
To: php-general@lists.php.net
Subject: [PHP] Displaying data from db
Hi,
I have several questions.
First what would be the best solution to take the records from the
database and display like 10 results per page?
Another question, the same records from the database, but say I want to
sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.......... etc.
And if I click 'a' I only get records with name starting with A. Is this
possible?
I am not necessarily asking for a complete code to reuse, just the
logic, how it would work.
Thanks in advance,
Vlad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php