I would use something like this (assuming you're just going to read the entire file and bung it into the database).
Be careful reading large files in, it can fill up PHP's allocated memory resource. I've used this with 4 meg files though, and its worked ok. $fp = file("yourfile.txt"); //This reads the file into an array, each element of the array is a line. Which you can then, test, manipulate, explode etc to put into the database. while (list($barry, $tbone) = each($fp)) { //barry is the index of the array element, $tbone is the value of that element in the array. echo"Index: $barry Value: $tbone <BR>"; //just insert into the database what you need to. } Best Regards Bob Irwin Server Admin & Web Programmer Planet Netcom ----- Original Message ----- From: "Mark Tehara" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 1:02 PM Subject: [PHP] fopen and file dump to a databace... > HI, I'm looking to take the data from a CSV file, then upload it into a > mysql databace. > > I figure i will need the following. > > To count the number of lines ... and cut up each line in its veriables then > entering it into the databace. > > I have: > > $file = fopen("pricelist-snippet.csv","r"); > $buffer = fread($file,10000); > echo $buffer; > > This dumps the data to the screen ... > > where would i start to making cutting this data up by the line? > > / Mark > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php