If you're unable to get to the bottom of this problem, you could probably
use PHP's trim() function to massage the data after the table's been
created. The basic algorithm would be to iterate through each record and
replace e.g. $country_name with trim ( $country_name ). Annoying to do, but
much quicker than manually entering data. Again, that suggestion applies
only if somebody doesn't have insight into the underlying cause.
Mitch
>-----Original Message-----
>From: James Duncan [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, March 04, 2001 5:21 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] Reading data from MySQL
>
>
>Hi folks,
>
>I have a problem. I think it's the way I'm inputting data into MySQL table.
>What I'm trying to do is insert data from a DOS text file into a MySQL
>Table. The DOS text file has a country name on each line, like:
>
>United Kingdom
>United States
>
>I'm trying to populate a MySQL table called Countries from the MySQL client
>like:
>
>LOAD DATA LOCAL INFILE "countries.txt" INTO TABLE Countries;
>
>All the records are created but when I echo them to screen with PHP every
>country has a space after it, like:
>
>"United Kingdom "
>
>What am I doing wrong? It's not my PHP code because if I create a table and
>manually fill it with values the space isn't present. However, I don't want
>to manually have to enter 290 odd countries into the table! So I'm assuming
>it's the input file format or I'm missing something on the LOAD DATA
>command? However, I have tried saving in every format present in Word (such
>as Text Only, MS DOS Only, etc) but with no success.
>
>The MySQL documentation says you can set the end of line marker explicitly
>in the LOAD DATA statement. How do you do this?
>
>Many thanks
>
>James
>
>
>
>--
>PHP Windows 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 Windows 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]