RE: [PHP] Using php to insert ' ' in between fields...
| From: | Sam | Date: | Tue, 29 Aug 2000 13:37:18 +0000 |
| Subject: | RE: [PHP] Using php to insert ' ' in between fields... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14111@lists.php.net to get a copy of this message | ||
Thanks for your responses, but please bear with me as I am v. new to php.
How can I use the code below...
$before = ",";
$after = "\',";
$data = str_replace( $before, $after, $data );
With a newly uploaded text file?
Do I have to open the text file first, or leave it closed?
I.e. a bit more help if you dont mind?
Thanks
Sam
-----Original Message-----
From: M.vanderMerwe@expro.shell.co.uk
[mailto:M.vanderMerwe@expro.shell.co.uk]
Sent: 29 August 2000 13:47
To: Sam@dragoman.co.uk
Subject: RE: [PHP] Using php to insert ' ' in between fields...
If I understand you correctly, you want to have:
'HQZ','1','HQZ50','1','Quito', etc ....
Try:
$before = ",";
$after = "\',";
$data = str_replace( $before, $after, $data );
Thys
-----Original Message-----
From: Sam [mailto:Sam@dragoman.co.uk]
Sent: 29 August 2000 13:59
To: php-general
Cc: Sam
Subject: [PHP] Using php to insert ' ' in between fields...
Hi all,
I have a text file that has been derived from exporting from MS-Access.
It will be uploaded to my website via a web page.
I have been able to produce out put like this...
HQZ,1,HQZ50,1,Quito,00/8/20 00:00:00,La Paz,00/10/1 00:00:00,£2120.00,0,
HEP,1,HEP50,1,Quito,00/8/20 00:00:00,Lima,00/9/9 00:00:00,£1095.00,0,
This is an example of two records.
Is there any way of using PHP to place each field inbetween ' ', so
that it
can be entered into a mySQL database?
Thanks in advance
Sam Rose