|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
creating google like subdirectories
alright so I wondering,
For such places as google, yahoo, different directories on the web, how are they made? IE, I want to make a directory, maybe called People. Now I want to make sure people can find specific people, say, jennifer aniston. Now I don't want to have to make a a jennifer aniston directory. I just want it if I need it. Should I just let a user create a new directory? Is there some way to sort information easily, putting multiple entries into one place? Or is this jsut something I should set up when I make the directory? Thanks for your help guys.
__________________
hey it's the CHARKING Last edited by thecharking : September 8th, 2003 at 08:41 PM. |
|
#2
|
||||
|
||||
|
Use a database. That's all there is too it.
|
|
#3
|
|||
|
|||
|
thanks
yes, I was going to usea database anyway, I jsut meant for the presenting of the data. I think I am jsut going to make the different areas manually at start up, and try to be broad enough that I don't have to add many more. Thank you though. Oh and sorry, I just realized my post title {hope someone sees this} was way too broad. Sorry.
|
|
#4
|
||||
|
||||
|
Presententation of the data? Not really clear what you mean. A good a navigation system, and search engine is all you will really need.
|
|
#5
|
|||
|
|||
|
sorry
man i am not being specific lately eh? sorry about that. what I meant was...
let's say I have a database row table called tv. In this I have a row called people. but lets say there are many posts put into people, all the same type, lets say three for jennifer aniston. Although I imagine the table would remian the same ( just $name=jennifer aniston; mysql_query("SELECT * FROM tv WHERE people= '" . $name . "'"); then show the results... ) I want the users to see subdirectories, such as, people > jennifer aniston I actually just had an idea: would this be done by count? just runa query and see if there are maybe 5 or more entries that are equal? If so, I jsut thought a problem with that: When the user loads the page, unless they are searching for a particular person (jennifer aniston), it can't compare db values can it? Because it can't say if($count) >= 5, do this... I can't word it right I don't think, I hope you understand what I mean by this. It has no inital thing to compare to, to count against. So... is this the right way of doing it? I jsut thought of it, so I am doubtful. Thanks for your help so far, hope I cleared up what I meant. |
|
#6
|
||||
|
||||
|
What kind of info are you storing on each person? Say you wanted to store a list of actors, and movies, and what movies each actor had been in.
You would have a seperate table for people, it would look something like: TABLE: people personid fname lname description TABLE: movies (only hold movie info) movieid movie_name description TABLE: people_movies (the bridging table) movieid personid Then, to see what movies Jennifer Anniston has been in, you'd perform a query which JOINS the movies and people_movies tables Code:
SELECT movie_name FROM movies m INNER JOIN people_movies pm ON m.movieid = pm.movieid WHERE pm.personid = X |
|
#7
|
|||
|
|||
|
thanks again
interesting idea, but I'm not sure if that's what I'm going for. Although I think it will come in handy later on. I'm really just looking to make things consolidate as they are entered, really has not much to do with the db I don't think...
A google search for jennifer aniston brought up this catagory: Arts > Celebrities > A > Aniston, Jennifer Now, I can see that it wouldn't be too hard to set it up to have an arts section, and then celebrities, and even a, as the alphabet is pretty generic, but it seemed crazy to me that google manually entered information to make a subdirectory for jennifer aniston. I hope you get me now... maybe I didn't understand your last post. Bu what I'm getting at I think is an appearance setting... maybe it's jsut a table called A that stores different names, and hers was stored after so many queries maybe? |
|
#8
|
||||
|
||||
|
Google wouldn't actually store "A" any where in their system. It would purely be a presentation thing. As I mentioned, there would still be a people table. The data is presented like this:
SELECT DISTINCT substr(fname,1) FROM people to get a first-letter listing. You need to think about how your DB would be designed so that data is normalised (no redundancy). Having a table just containing the letters of the alphabet is redundant. |
|
#9
|
|||
|
|||
|
correct
okay, yeah an alphabet table would be pretty ridiculous.
I was wondering, I haven't used JOIN before really in queries, I am still quite new at php. Is there a reason with the "movies m" and "people_movies pm" in the query? I've never seen this abbrieviated letters after selecting the table. But I think I am still lost on the directory system, sorry. I can see how it would be easy to get a first letter listing. But I don't understand how thes elinks are made! Ahh the frsutration. |
|
#10
|
||||
|
||||
|
Forget about the directory structure stuff. It only exists because of the database. It's purely a presentation type thing.
Join's are a major part of database design - I strongly recommend that you grab a book on database building. You won't get far without it. The abbreviation after my table names are called aliases. They are simply used as a shortcut to referring to your tables later on (e.g. "m.movieid = pm.movieid WHERE pm.personid"). |
|
#11
|
|||
|
|||
|
thinking about it
okay so i thought about this some more, and put it off, and then thought about it more, and I think I have an idea.
Maybe I'm missing the point, but I think this would work, too. The user goes into virtual dir. in site. this displays letters a-z. these are not db related; just dislayed. But when clicked, the db query is searching for items LIKE %#. Maybe use substring. Anyway, not important right now. This displays catagories that begin with a, WHICH I THINK are achieved by simply searching through the diff rows for words that begin with a and then making a count of it. If words are over a certain limit (like 50), then that is a catagory, and so on. Is this it? or will this work? Thanks for the reply's I really appreciate them. And I suppose I'll need to buy a php/mysql book; I jsut haven't run into a problem I can't solve yet( with help oc), although I bet I could make my scripts MUCH better. I jsut rewrote a few scripts into one page because they were all similar; but the error checking was TEDIOUS. Any way, thanks. |
|
#12
|
||||
|
||||
|
Are you now talking about something else? I'm not really following. We've established that for your system to be setup neatly, you'll need a table for people, and perhaps a table for movies.
You mentioned categories. What are these? What are they related to? What functionality do they bring to the site. Doing '%%' searches is ineffiecient, and the way describe using them to gather your categories sounds like a bit of a hack. i.e - not maintainable, no structure. Honestly, as system such as this can only really be built with a solid database sturcture underneath, in order for it to be maintable, normalised, efficient, etc. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > hope people see this |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|