944,051 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2569
  • PHP RSS
Nov 20th, 2004
0

Database Design

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
qazs is offline Offline
7 posts
since Oct 2004
Nov 20th, 2004
0

Re: Database Design

The second way will be quicker and easier.

You can use SQL to connect to you DB and search and sort, for example:

PHP Syntax (Toggle Plain Text)
  1. SELECT *
  2. FROM userData
  3. WHERE user_age > 30
  4. AND user_type = 'NORMAL'
  5. 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.
Team Colleague
Reputation Points: 63
Solved Threads: 6
Supreme Evil Overlord
Roberdin is offline Offline
282 posts
since Feb 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Variable Validation & MYSQL
Next Thread in PHP Forum Timeline: how to change the value of a URL argument?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC