•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,053 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,285 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1979 | Replies: 1
![]() |
| |
•
•
Join Date: Oct 2004
Location: Singapore
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I'm looking for some advice regarding creating a well-designed database site.
The scenario is this:
I have a main database that holds all my users' data,
I'll call it UserData.
Now I want to make a sort of Search By Category form, which will
output those users from UserData which meet the criteria.
Ive thought of 2 ways to do this:
1. Create a new table. Then connect to UserData,
grab the necessary info and dump them into the new table.
Then the user can manipulate this new table.
Connection to UserData is closed.
2. Connect to UserData everytime something is performed, like search or sort etc.
So which do you think is a better way? Thanks for any advice.
I'm looking for some advice regarding creating a well-designed database site.
The scenario is this:
I have a main database that holds all my users' data,
I'll call it UserData.
Now I want to make a sort of Search By Category form, which will
output those users from UserData which meet the criteria.
Ive thought of 2 ways to do this:
1. Create a new table. Then connect to UserData,
grab the necessary info and dump them into the new table.
Then the user can manipulate this new table.
Connection to UserData is closed.
2. Connect to UserData everytime something is performed, like search or sort etc.
So which do you think is a better way? Thanks for any advice.
•
•
Join Date: Feb 2003
Location: London, England
Posts: 281
Reputation:
Rep Power: 7
Solved Threads: 6
The second way will be quicker and easier.
You can use SQL to connect to you DB and search and sort, for example:
The hereinbefore inserted query will, assuming that you have the table setup appropriately, select all fields from the UserData table - but only records where the user is over 30 and is of type 'NORMAL'. The records are sorted by username, ascending.
SQL (Structured Query Language) allows you do setup these queries easily and simply. PHP can then grab the results of the query and display it in a table, or any HTML that you like, really.
You can use SQL to connect to you DB and search and sort, for example:
SELECT * FROM userData WHERE user_age > 30 AND user_type = 'NORMAL' ORDER BY username ASC
The hereinbefore inserted query will, assuming that you have the table setup appropriately, select all fields from the UserData table - but only records where the user is over 30 and is of type 'NORMAL'. The records are sorted by username, ascending.
SQL (Structured Query Language) allows you do setup these queries easily and simply. PHP can then grab the results of the query and display it in a table, or any HTML that you like, really.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
- Database design regarding two 'linking' tables (Database Design)
- Database Design for storing versions (Database Design)
- Database Design feedback (absolute beginner here :) (Database Design)
- Help with contact/mailing list database design... (Database Design)
- Database design - subtypes and instances of an entity (Database Design)
- Database Design - Supertypes and Subtypes (Database Design)
- Database design (Database Design)
- Database Design Advice (MySQL)
Other Threads in the PHP Forum
- Previous Thread: Variable Validation & MYSQL
- Next Thread: how to change the value of a URL argument?


Hybrid Mode