?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?php txt database?
Author:??(65.243.94.---)
Date:???06-04-03 07:59

Ok, this is what i'm looking for, maybe someone can point me into the right direction. I have a txt file that has fields seperated by commas. What i'm looking for is a php script that people can use to view the data in the txt files with a nice web interface. Any ideas?

?Re: php txt database?
Author:??(---.cpe.net.cable.roger)
Date:???06-04-03 09:09

yeah, read the manual


http://ca2.php.net/manual/en/function.fgetcsv.php

?Re: php txt database?
Author:??(65.243.94.---)
Date:???06-04-03 10:01

well, i'm not a programmer. i have no idea how to write the script but if you know of some premade i'm fairly decent at editing them to work for me

?Re: php txt database?
Author:??(---.cpe.net.cable.roger)
Date:???06-04-03 10:40

$row = 1;

/open the file for read access
$handle = fopen ("test.txt","r");

//loop through the data one line of 1000 chars (must be greater
//than longest line) at a time
while ($data = fgetcsv ($handle, 1000, ",")) {
//get the number of elements in a line
$num = count ($data);
print "

$num fields in line $row:
\n";
$row++;
//loop through the data set
//can add html in here to make it a table etc
for ($c=0; $c < $num; $c++) {
print $data[$c] . "
\n";
}
}
fclose ($handle);
?>

?Re: php txt database?
Author:??(---.bluecom.no)
Date:???06-05-03 03:08

If you plan to use a text file as a database - and you got a lot of information in it... it would be REALY smart to read about FlatFile! It givs you a lot of database functions!
The best thing would be to use s sql database like mySQL, but if you don't want to / can use a sql database, then use FlatFile!

Here is the link to Project FFDB-PHP
Flat File DataBase for PHP
http://ffdb-php.sourceforge.net/

?Re: php txt database?
Author:??(65.243.94.---)
Date:???06-05-03 06:39

thank you guys for all the info and code, i think i'm gonna go mysql, i already have a database that is in a text file, are there any easy ways to get this flatext file into a mysql database?

?Re: php txt database?
Author:??(65.243.94.---)
Date:???06-05-03 06:40

sorry, had to repost because i forgot to check that nice little box at the bottom there

Go to Top??|??Go to Topic??|??Threaded View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??

Provided By
Phorum