Reply to Re: [PHP] searching through a mysql db/tbl

Your name:

Reply:


Posted by Stephen Johnson on 10/21/13 11:26

On 9/10/05 3:13 PM, "bruce" <bedouglas@earthlink.net> wrote:

> if i allow a user to search on say 'aa', i'd like the user to be able to
> get:
>
> name email foo...
> aa a@b.com dddd
> b1 aa@f.com 123
>
> any ideas as to how i could go about and create the query, or what would i
> need to do to have this result...

Use like in your select statement ...

Select name, email, foo from tbl where email like '%aa%';



> 2) if i have a query that produces a number of rows, how/what would i need
> to do, to limit the number of rows displayed, and to allow the user to
> select a 'back/next' button that would generate/display the next 'N' items
> in the list/query results...
>

Use limit in your select statement

Select * from tbl limit 10;

You can also use a start in the limit so the next button would call this
select.

Select * from tbl limit 10, 10;

> if anybody could direct me to sample docs/code that kind of describes/solves
> what i've described, i'd appreciate it!!!

The folks on the MySQL list can help you with these questions better then
the folks here on the PHP list.



>
> thanks
>
> -bruce
> bedouglas@earthlink.net

--
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

stephen@thelonecoder.com
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация