Forum Moderators: coopster

Message Too Old, No Replies

Clicking a name to get all information using mySql and PHP

mySql and Phpwebsite content

         

larneman

2:36 pm on Jan 29, 2005 (gmt 0)

10+ Year Member


I am looking for an example or help in building a contents driven website, I have 12,000 names that are registered on the WW1 Tower Hill Monument 1914-1918.
I would like users to click on a name and that they then would get all the information present in the database on that person.
Do I need to make 12,000 hyperlinks or what.?
I have read 3 books on using Php/mysql to fill a website but they are more concerned with updating the database etc.
This is a non-profit venture. I think it should be easy but seem to miss the clue?
Anybody like to help me with the scripting or examples or direction to a script etc. Filling the database etc is not a problem. Presenting the data is as I have no wish to built 12000 HTML pages

greetings from Hoogwoud, The Netherlands

Liam

oceanwave

4:42 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



I am a beginner too, so I hope I am explaining this correctly. One possibility is presenting a search form to your users where they can use the select option (drop down menus) to choose certain characteristics of the person they are looking for (based upon some of the categories in your database). After selecting their choices, the user submits the form, which queries your database. Only those entries that match their query are displayed. The user then selects the person they are interested in, and they are directed to the page about that person. This page is based upon the query to the database, and DOES NOT have to be programmed by you 12,000 times. The page inserts the corrsponding database information based upon the selection made by the user (and the query you programmed). Of course, this is only one way to accomplish what you want to do.

Try doing a Google search on php and database search forms. I think this might be helpful.

The best of luck to you!

mincklerstraat

5:17 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey, larneman, welcome to Webmasterworld. What oceanwave says sounds pretty good to me so I won't bore you with extra details. Warme groeten uit Diest / Leuven België, veel sukses met je project.

ergophobe

8:10 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's pretty much like my main project - a biographical database of sixteenth century Genevans.

I just have a "quick search" box at the top of every page that lets someone search by any one field in the DB and then a link to an advanced search page that let's people construct relatively complicated searches on any and all fields.

The search results are presented in a large table that defaults to whatever number the user sets in their preferences (this is a log-in only site), so usually 50 or 100. Each record in the table has a link to view the personal details.

Once viewing the detailed record, there are arrows back and forth that let people page through the result set of the last search.

There's actually no real way to just access a long list of 1000s of URLs in my case because I didn't see the point to it - it's unlikely that anybody would use my data that way.

All the responses you've gotten so far are pretty vague, but that's partly because we don't know much about what you ultimately want to do. Maybe you could tell us

- what data have you captured already?
- how is it stored/structured?
- who is the site aimed at?
- what information do you want to present to them and how?

Also, check out the forum library (link at the top of the page) for some threads on the basics of extracting data from databases and CSV files.

larneman

8:58 pm on Jan 29, 2005 (gmt 0)

10+ Year Member


Thanks for the replies so far and the good advice.

What am trying to do. That is a good question.

The Monument in question only contains names of the Merchant Navy Sailor that died in the Great War. I want to give access to anybody that click on a name to all the information on that person.

I have HTML pages which contain the Surnames and christian names. Click on the surname and then you jump to a new page which contains a text message with all the information on that person.

Later I will expand with pages which contain the 1700 odd ships that these men served on. This will supply the history of the ship, when sunk, how old, when built etc. and who died on it
Also then I will add more ways of searching the database

Their nationalities , 35 plus.

I have mySql tables which contain:-
Surname
First name
Second name
rank
service
age
date died
ship
relationship(1)(son/daughter of)
relationship(2)(husband/wife of)
address(1)
address(2)
address(3)
born
Nationality
TEXT:- that contains all the above

All I want to do is make a start as I have all the surnames etc. in an excel file and all the text information in an RTF file.

Researching the ships will take many months if not years. (This is a hobby, after all)

greetings

Liam

ergophobe

9:57 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So I would want something like this

table sailor
-----------
sailor_id

surname

first_name

other_names

date died

born
[note that I deleted age from the personal information -it's redundant if you have birth date, you don't need age]

street_address

address_town_id
[A text field is better if you don't want to go to the trouble of verifying towns carefully, which can be exceedingly hard if you don't have good records. In my case, I can never tell which of the many "Chalons" in France someone comes from, for example. Also, you would need drop-down select fields to do this and it could quickly get way too cumbersome with thousands of towns]

address_district_id
[this is state, province, canton, whatever]

address_country_id

nationality_id [because some people do not have the same nationality as the country they live in]

rank_id

service_id

ship_id

Now, every column that ends in "_id" relates to another column so address_country_id and nationality_id are both keyed to the countries tables which has the columns

country_table
-----------------
country_id
country_name

ship_table
---------------
ship_id
ship_name
ship_nationality_id
ship_tonnage
etc

Finally, for the relationships, it depends on what you want to do here. If you want to find brothers, sisters, and so on, there are several ways to go. If you just want to record the names, they could just be fields within the sailor table.

larneman

2:22 am on Jan 30, 2005 (gmt 0)

10+ Year Member



You quite correct in the useage of data normalisation.

What you have done is what I intended to do at a later date. Thanks for saving me some work.

At the moment I am stuck with the PHP side of thing. The concepts are in my mind so vague. I am an old fashion in just having worked in basic and VBA in Excel and Access.
The useage of standard SQL is not strange to me either. But using C++ or Java or PHP is a bit of a mystery. I have read about how if somebody enters information in a form and uses POST or GET he easily retrive information from mySQL.

The information I have come from this the web and is stactic.

Casualty Details
Name: ABBOTT, HENRY
Initials: H
Nationality: United Kingdom
Rank: Able Seaman
Regiment: Mercantile Marine
Unit Text: S.S. "Minnehaha" (Belfast)
Age: 62
Date of Death: 07/09/1917
Additional information: Son of Henry and Emily Abbott; husband of Letitia Abbott, of 181, Tilbury Dwellings, Tilbury, Essex. Born at Devonport.
Casualty Type: Commonwealth War Dead
Cemetery: TOWER HILL MEMORIAL

That is the information that I have 12000 times and just want to make a selection by clicking on a surname.

I just to look at a few examples of PHP scripts that might help me. The people using the site, at the start will just be people that want to see if they family member is recorded properly. They will not want to click pulldown menu's or update the database.

Hope that somebody might grasp what I trying but ofcourse there is a good possibility that I am approaching the problem in an incorrect method. So am will to hear your views on all possible solutions.

greetings

Liam

[edited by: ergophobe at 12:20 am (utc) on Jan. 31, 2005]
[edit reason] URL deleted as per Terms of Service [/edit]