![]() |
Display Records From Database
I wana show records from database
All data starts with "A" under Alphabet A All data starts with "B" Under Alphabet B formate should be minimum 2 column. Like that exmple i have upload please open below link http://shoaibmunir.com/talkphp1.htm i will be please by helping you |
SELECT * FROM tableA WHERE column1 LIKE 'A%'
|
thank's for your reply but i want to display all a-z records.
did you check link please check then maybe you will got my point. |
Well you could run this query 26 times - but I wont recommend it.
You have a few options: - (MYSQL) You could use a stored procedure - (MYSQL) Use CASE & CONCAT in mysql - (PHP) Loop each result and substr the 1st letter and append an array accordingly The php option is probably the simplest to implement but maybe not the most efficient. |
how can i do can you explain me with write php code?
|
Quote:
PHP Code:
|
A query like this should work:
Code:
SELECT Code:
Apple APHP Code:
|
| All times are GMT. The time now is 10:33 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0