Hmmm.. this is not a small question.
There are various methods of collating results from more than one database depending on the databases in question, are they all the same for example (MS SQLserver or Oracle ir MySQL) and are they on the same server or spread all over, in one domain or several.
I suspect buzzle.com has one database in which each entry has a type atribute (chapter, article or link)
example:
----------------------------------------------------------------------------------------------------
| Table: Content |
========================================================
|ID |Type |Keywords |URL |
========================================================
|1 |Chapter |buzz buzzle | http://buzzle.com |
|2 |Article |buzz buzzle | http://buzzle.com/articles/buzzle.asp |
|3 |Link |buzz buzzle | http://buzzle.com/links/index.asp?id=1234 |
========================================================
The SQL query to retreive the data:
SELECT * FROM content WHERE keywords LIKE '%buzzle%' ORDER BY type
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Not being a small question, does that mean that this may be too difficult for a newbie (me!) to be talked through to accomplish?
.
Well we are all newbies at some point. I must say for a newb your project does sound ambitious, but don't let that put you off. The key is to break it down into managable chunks. My first concern is why you feel the need to store this data in three seperate databases? instead of all together in one.
How familiar are the terms: relational data; normalisation; set theory; to you? Have you heard of a guy called F Codd ?
Your answers will help me to establish what stage you are at so I can point you in the right direction.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
I suspect buzzle.com has one database in which each entry has a type atribute (chapter, article or link)
I thought the same thing. Alternatively though, you could connect to each database separately and perform the same query.
Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
OK Justin,
Can we have a look at this link script then please?
Is your site online yet ? what's the URL?
Like Phaelax says if you have incorporated several add-on databases to your site it is possible to query each one and concatenate the results for display as one list split by catagory.
How depends on what you have, is your site using PHP ? or ASP for example.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Can you divulge what script/package you are proposing to use, so I can look at the instructions myself. I can't tell you unless I know what database you have already and what exactly it is your want to install.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Ok the instructions expect you to create a new database and user for the script to install it's tables and data to. So I would go with that, as we have established it's no problem to query across databases.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Check these links: (all from the PHP site)
Handling HTML form input (where your site visitors will key their search string)
http://uk2.php.net/manual/en/tutorial.forms.php
Connecting and queryingyour MySql databases
http://uk2.php.net/manual/en/function.mysql-db-query.php
You are interested in mysql_connect and my_sql_query
You will need to take the search criteria from the form, and connect to each database in turn retreiving a recordset from each, then output them using a loop to generate HTML to the page from the results.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68