Stephen Tiano wrote:

I'm just starting out, doing tutorials and exercises up the wazoo, trying to learn MySQL and PHP.

I've created a table in a test database. When I do a DESCRIBE [table_name], the columns come up just as they should. Populating them with data's another story.

I've created a textfile in a text editor. The first row is the column heads;
Why?

succeeding rows are actual data. The entries in a row are separated by a single tab; at the end of a row, I'm hitting <RETURN>.
Did you specify  that lines be terminated by  '\r' ?

I entered twelve rows of data. The book I'm working from shows "NULL" as some entries; and the last column, shows a timestamp in each cell of that last column. I typed "NULL"
I believe that should be  \N

every time my sample showed it and all fourteen digits of each timestamp entry. So far, so good?

Back in MySQL, at the prompt, I entered:

load data local infile '

and then I dragged the textfile into the Terminal window. I was greeted with:

Query OK, 1 row affected (0.44 sec)
Records: 1 Deleted: 0 Skipped: 0 Warnings: 3

Question: Where do I find these "Warnings" named and detailed?
You have only one record, because you have only 1 line.
RETURN is not the default line terminator.
You can't see the warnings.



When I do a SELECT * FROM [table_name], the column heads appear just fine, where and as they should. But there's only a single row of data, when I typed in twelve rows in the textfile. Also, that one row of data is all wrong. Only the first column, entitled "userid" is correct, the number "1". The other entries merely parrot the column heads, and they're off by one, with the second and third in the second column, and all entries incorrectly moved one column to the left. The last column, which is where the timestamp should go, contains a batch of zeros.

What do I need to do to fix this?

Fix your input file, and use the right options for the load data command.
Posting bothe would have helped.


Thank you.

Steve Tiano





---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to