Re: PHP/MYSQL Question...
From: Armando Padilla (mando81_at_prodigy.net)
Date: 10/05/04
- Previous message: nipepsi: "Re: sending html email using php script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Oct 2004 10:32:56 -0700
Hi, dont know if you got your answer but the best way to go about this
is maybe:
1) Write a script to browse the folder you are working on.
2) Detect the file and open.
3) Once in the file, for each line explode the string by "/" <- is the
delimeter you are using in this case it was a /. The explode function
in php will give you an array of elements which you can loop through
and throw them into a table.
That is a good start.
Armando Padilla
http://www.armando.ws
don@donnybravos.com (Webmaster) wrote in message news:<dfbb4f0d.0409110217.608eebca@posting.google.com>...
> Hi everyone...
>
> I have a directory of text files that i'd like to import into a msql
> table... I was wondering if there's an easier way to do this with
> php/mysql, I'd like to avoid copy/pasting the entire directory
> (thousands of files) into the database if i can.
>
> The directory structure of the text files resembles...
>
> Music/A/Aerosmith/Song Name.txt - (extention varies)
>
> What i'd like to do is use php to scan the directory and input
> everything into a table like...
>
> Dir Artist Song Text File
> Type
> ------------------------------------------------------------------------
> A Aerosmith Song Name Fa La La La La (example text) File Ext
> B Beatles Song Name Fa La La La La (example text) File Ext
>
>
> I'm fairly new to php/mysql and have been banging my head against my
> desk for too long on this one... if you can offer up any ideas -
> please do.
>
> Thanks in advance for your help!
>
> Don Bedford.
>
>
>
> Maybe if I stop banging my head on my desk the answer'll come to me...
> ------------------------------------------------------------------------
- Previous message: nipepsi: "Re: sending html email using php script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|