I'm with you on that.  Many times we preach against "reinventing the wheel",
but sometimes doing that can help you learn an awful lot about "the wheel".
I also find that some of my best learning comes from taking on a hard
project and just trying to make my own solution to it.  Anyway...

You might try this instead.  Just two tables:
FILENAMES TABLE
column1 = ID (a unique auto_increment integer)
column2 = FileName

WORDS TABLE
column1 = ID (a unique auto_increment integer)
column2 = Word
column3 = Occurrances
column4 = FileNameID (integer corresponding to ID in FILENAMES TABLE to
connect which words go with which files)

This way you only end up with two tables, but you will have lots of rows.
Also, you don't have to create tables on-the-fly everytime your script
encounters a new word (I don't like letting my scripts do too much in the
database).  I'm sure there are better ways but that's my two cents.

Duncan
--
Duncan Salada | Titan | www.titan.com/testeval
Email: [EMAIL PROTECTED] | Voice: 301-925-3222x375 | Fax: 301-925-3216

> -----Original Message-----
> From: julian haffegee [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 12, 2002 8:50 AM
> To: MySQL General List
> Subject: Re: site search
> 
> 
> Thanks Kim and Georg,
> 
> but I want to do this myself! Ok it may be hard, but i'm confident....
> I have taught myself an awful lot by having a 'difficult' 
> project on the go
> 
> so, bearing that in mind, can I re-ask my question!
> 
> thanks again
> 
> incidently I am making a SITE search, not a web search engine
> Jules
> >
> > > Hi everyone,
> > >
> > > I want to build a MySQL site search. Can anyone help with 
> my 'overview'
> > >
> > > I have written a perl programme to open each html file, 
> cut out all the
> tags
> > > and create a hash of hashes each word is a key, then the 
> secondary key
> is
> > > the filename, then the value is the number of occurances in that
> document.
> > >
> > > So how should I make my SQL tables? I thought a 2 column
> > > (filename:occurances) table for each word would be the 
> best way, but
> thats A
> > > LOT of tables. I'd get perl to do all the writing, and 
> I'm sure I could
> get
> > > it to work this way.
> > >
> > > But is this the best way? I'm fairly new to MySQL so 
> please be explicit!
> > >
> > > thanks for your time
> > >
> > > Jules
> > >
> > >
> > > 
> ---------------------------------------------------------------------
> > > Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > > To request this thread, e-mail 
> <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: 
http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to