RE: [PHP-DB] Individual Lines of text

2001-09-25 Thread Boget, Chris

> I need to know if it is possible with PHP to write a script 
> that will pull the individual lines of this text file and store 
> them into a mysql database line by line.

use file() and then loop through the array.

Chris



RE: [PHP-DB] Individual Lines of text

2001-09-24 Thread Beau Lebens

or you can fopen() the text file, then fgetcsv() each line, using "," as a
separator, which is just a neat, clean way of doing explodes :)

enjoy
beau

// -Original Message-
// From: Andreas D. Landmark [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 25 September 2001 8:27 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Individual Lines of text
// 
// 
// At 25.09.2001 01:19, Devon wrote:
// >I am pulling down data from a switch which looks like
// >
// >Port 1, 33889029532
// >Port 2, 0
// >Port 3, 135852
// >Port 4, 6652941243
// >etc etc
// >
// >I need to know if it is possible with PHP to write a script 
// that will pull
// >the individual lines of this text file and store them into 
// a mysql database
// >line by line.
// >
// >Cheers
// 
// if the lines are exactly as you describe them (ie. 
// comma-separated) read 
// the file
// line by line and use the explode() function to create an 
// array of each line 
// and flush
// it to the db of your choice...
// 
// 
// 
// -- 
// Andreas D Landmark / noXtension
// Real Time, adj.:
//  Here and now, as opposed to fake time, which only 
// occurs there
// and then.
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Individual Lines of text

2001-09-24 Thread Andreas D. Landmark

At 25.09.2001 01:19, Devon wrote:
>I am pulling down data from a switch which looks like
>
>Port 1, 33889029532
>Port 2, 0
>Port 3, 135852
>Port 4, 6652941243
>etc etc
>
>I need to know if it is possible with PHP to write a script that will pull
>the individual lines of this text file and store them into a mysql database
>line by line.
>
>Cheers

if the lines are exactly as you describe them (ie. comma-separated) read 
the file
line by line and use the explode() function to create an array of each line 
and flush
it to the db of your choice...



-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]