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?
/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);
?>
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/
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?