PHP/MYSQL - General question on my case
Posted: Wed Oct 15, 2008 5:51 pm
Hello,
I would like to get some recommendation or advice on building my own website.
My database contains example of below data.
Person
------
UID
FirstName
LastName
Info (Can contain multiple info on single person)
----
UID
Person_UID(as foreign key)
Information.
Here is some description on what I want to do with my navigation.
There will be menu/link from main page called "Person".
It will link to a page with A to Z alpabet links.
So when you click on 'A', it will retreive data of people's LastName starting with 'A'.
I don't know whether I should build a different page for A, B, C... through to Z
and how do I refresh the page with new data on the same page when <a href...>link</a> is clicked?
I am familiar with form actioning to it self using PHP_SELF but not too familiar with single link.
So summarizing in transactional term,
Click on "People" will direct me to http://website.com/people.php from in index page.
It will lists Alphabets using a loop with default data of random people.
when someone clicks letter 'C' it will send sql query to database to look for...
Select * from People where LastName (start with C).
...
$UID = $result['UID'];
$FirstName = $result['FirstName'];
$LastName = $result['LastName'];
and it will print out the on the same page.
When someone named "Stephen Charlie" is clicked, it should send query to database looking for
Select * from Info where PersonUID = (ID of a selected person)
and display on a new page called person_info.php.
I will do a mod-rewrite to make URL looks like http://website.com/person/Stephen-Charlie
So what I am not sure is whether this is good way of building a page and how to show different data (when requested) on the same page.
I would like to get some recommendation or advice on building my own website.
My database contains example of below data.
Person
------
UID
FirstName
LastName
Info (Can contain multiple info on single person)
----
UID
Person_UID(as foreign key)
Information.
Here is some description on what I want to do with my navigation.
There will be menu/link from main page called "Person".
It will link to a page with A to Z alpabet links.
So when you click on 'A', it will retreive data of people's LastName starting with 'A'.
I don't know whether I should build a different page for A, B, C... through to Z
and how do I refresh the page with new data on the same page when <a href...>link</a> is clicked?
I am familiar with form actioning to it self using PHP_SELF but not too familiar with single link.
So summarizing in transactional term,
Click on "People" will direct me to http://website.com/people.php from in index page.
It will lists Alphabets using a loop with default data of random people.
when someone clicks letter 'C' it will send sql query to database to look for...
Select * from People where LastName (start with C).
...
$UID = $result['UID'];
$FirstName = $result['FirstName'];
$LastName = $result['LastName'];
and it will print out the on the same page.
When someone named "Stephen Charlie" is clicked, it should send query to database looking for
Select * from Info where PersonUID = (ID of a selected person)
and display on a new page called person_info.php.
I will do a mod-rewrite to make URL looks like http://website.com/person/Stephen-Charlie
So what I am not sure is whether this is good way of building a page and how to show different data (when requested) on the same page.