View Single Post
  #4 (permalink)  
Old 04-08-08, 02:20 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
OK Phil what you will want to do is the following
PHP Code:

$handle fopen("/path/to/file""r");
if (
$handle) {
    while (!
feof($handle)) {
        
$buffer fgets($handle);
        
//WILL PARSE DATA SEPERATED BY TABS INTO SEPERATE ARRAY ELEMENTS
        
$arr explode("\t",$buffer);
#####################################
#########ADD TO DATABASE HERE########
#####################################
    
}
    
fclose($handle);

You will need to make a query where i have marked to insert the data into your mysql database. Also, you will need to connect to the database before the WHILE statement, and close the connection after the closing curly brace }

Hope that gets you started
Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName
Reply With Quote