PDA

View Full Version : Need Helpp Extracting Info From DB


steffield
03-05-2002, 02:03 PM
I have created a database for a web site to store church location and names in. I have created a page to input the information in to the database. But, I am having trouble finding a tutorial to get the info out from it.

I have uploaded a page to: http://clients.thedesignroom.net/aogeastern/new/church_database.php which, if you view the source, you will see what I want to happen using a few if/else comments.

The information has to come out in alphabetical order detemined on the $town field, and if matching towns are found, then to have a secondary sort on the $church field

Does anyone want to help me out with this?


Regards
Ian

JoeF
03-05-2002, 02:41 PM
SELECT * FROM TABLE ORDER BY TOWN,CHURCH;

That is your query.
If you run it from your mysql_select() statement you can then feed it into an array and etc etc.. it will already be in order.

steffield
03-05-2002, 02:56 PM
Thanks for that - I don't suppose you know of any tutorials that are any good for explaining to me how to extract it.

I also want to, in the list every time the first letter of a town changes, ie Harlow - Halesford - Ipswich to insert a horizontal line between Halesford and Ipswich, but not Harlow and Halesford.


Ian

JoeF
03-05-2002, 07:28 PM
i will show you how i did it later on when i get home, at work currently

steffield
03-05-2002, 07:44 PM
Thanks mate. If you want to message me on Yahoo, my id is spoondevil