(I am sorry if this is the wrong group for this posting, I cant find a
group on usenet for phpmyadmin, but maybe someone would be nice enough
to answer me anyway....)
I need to import data into a simple table The table has three fields.
The first is an auto increment value, the second the current time and
date (the 14 character version), and a field with some data.
This works okay in SQL mode
INSERT INTO all_epst VALUES ('',NOW(),'info test1');
INSERT INTO all_epst VALUES ('',NOW(),'info test2');
Using phpmyadmin I want to import this data from a csv file rather
than the workaround of creating sql script
Trouble is I cant get "current timestamp" to work. When I click on
import in phpmyadmin I can choose "csv" or "csv mha"
I try csv and set
row end to ;
field surround to '
field seperator to ,
The txt file for csv import contains
'',NOW(),'infot est1';'',NOW(), 'infotest2';
It imports the data and gives me the autoincrement value but the time
stamp is left as 0000-00-00 00:00:00
Feedback:
INSERT INTO `all_epst`
VALUES (
'', 'NOW()', 'infotest1'
)
INSERT INTO `all_epst`
VALUES (
'', 'NOW()', 'infotest2'
)
I tried another txt file with
'','','infotest 1';'','','infot est2';
Again, it imports the data and gives me the autoincrement value but
the time stamp is left as 0000-00-00 00:00:00
VALUES (
'', '', 'infotest1'
)
INSERT INTO `all_epst`
VALUES (
'', '', 'infotest2'
)
Note that the tabel is correctly structered with "CURRENT_TIMEST AMP"
as the default. The attribute ("ON UPDATE CURRENT_TIMESTA MP" is not
applicable as I am adding new values, but is set anyway.)
What am I missing? How do I import with a csv text file using
phpmyadmin?
Any help greatfully appreciated
Garry Jones
Sweden
group on usenet for phpmyadmin, but maybe someone would be nice enough
to answer me anyway....)
I need to import data into a simple table The table has three fields.
The first is an auto increment value, the second the current time and
date (the 14 character version), and a field with some data.
This works okay in SQL mode
INSERT INTO all_epst VALUES ('',NOW(),'info test1');
INSERT INTO all_epst VALUES ('',NOW(),'info test2');
Using phpmyadmin I want to import this data from a csv file rather
than the workaround of creating sql script
Trouble is I cant get "current timestamp" to work. When I click on
import in phpmyadmin I can choose "csv" or "csv mha"
I try csv and set
row end to ;
field surround to '
field seperator to ,
The txt file for csv import contains
'',NOW(),'infot est1';'',NOW(), 'infotest2';
It imports the data and gives me the autoincrement value but the time
stamp is left as 0000-00-00 00:00:00
Feedback:
INSERT INTO `all_epst`
VALUES (
'', 'NOW()', 'infotest1'
)
INSERT INTO `all_epst`
VALUES (
'', 'NOW()', 'infotest2'
)
I tried another txt file with
'','','infotest 1';'','','infot est2';
Again, it imports the data and gives me the autoincrement value but
the time stamp is left as 0000-00-00 00:00:00
VALUES (
'', '', 'infotest1'
)
INSERT INTO `all_epst`
VALUES (
'', '', 'infotest2'
)
Note that the tabel is correctly structered with "CURRENT_TIMEST AMP"
as the default. The attribute ("ON UPDATE CURRENT_TIMESTA MP" is not
applicable as I am adding new values, but is set anyway.)
What am I missing? How do I import with a csv text file using
phpmyadmin?
Any help greatfully appreciated
Garry Jones
Sweden
Comment