473,804 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php import to table failing

(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
Feb 24 '08 #1
2 2237

"GarryJones " <mo****@algonet .sewrote in message
news:52******** *************** ***********@u69 g2000hse.google groups.com...
(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
That's hard to figure out second-hand. My best suggestion is to eliminate
the "field surround" element, which you shouldn't need as long as the field
doesn't contain a comma. The feedback you got shows value 'NOW()', but
what you need (I think) is NOW() without single quotes around it. So I
suspect the field surround is supplying single quotes and then mysql is
reading it as a string rather than a function.

You also might try setting a default to NOW() instead of just relying on the
phpmydamin checkbox.

Another suggestion is to check the encoding of your source.

Feb 24 '08 #2
GarryJones wrote:
(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
You're right - phpMyAdmin isn't supported on usenet. They have their
own forums on sourceforge.

That's where you should be asking.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Feb 24 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2484
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for kk in k:
39
5690
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
4
12727
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as though the file may be too big! When I try to do it via command line: mysql -u root --host=localhost printing < ./printing.txt It eventually errors out with a "syntax error on line X" and only about
9
2772
by: Ed_No_Spam_Please_Weber | last post by:
Hello All & Thanks in advance for your help! Background: 1) tblT_Documents is the primary parent transaction table that has 10 fields and about 250,000 rows 2) There are 9 child tables with each having 3 fields each, their own PK; the FK back to the parent table; and the unique data for that table. There is a one to many relation between the parent and each of the 9 child rows. Each child table has between 100,000 and 300,000
1
4577
by: Juris Krumins | last post by:
Couple a weeks ago (19.08.03 Subject: Temporaty tables) I've posted message with question about errors I'm getting while using create temporaty table command. So I'm start digging in src code as Tom Lane did and found about 4 places where such kind pf errors could happend PostgreSQL 7.3.3 src/backend/catalog/dependency.c : 1621 src/backend/catalog/heap.c : 1663
3
4851
by: Neter Smith | last post by:
I have run into a problem when trying to import a WSDL reference under VS 2003 and 1.1 of the framework. It appears as if it is in the generation of the proxy that things are failing. When I add the reference, I get the following error: C:\Inetpub\wwwroot\WebServices\samples\WSDL\dotnet\OblixSampleForDotNetWSDL\Web References\localhost\Reference.map(1): Custom tool error: Unable to import WebService/Schema. A schema with the namespace...
3
9307
by: laredotornado | last post by:
Hello, My hosting company has MySQL 5 and so do I on my local Fedora Core 5 Linux machine. However, when I import a dump file from their enviornment into mine, I get this error ERROR 1064 (42000) at line 21428: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE `EC_SAVED_ORDER_LINE_ITEMS` ADD CONSTRAINT `FK1_SAVED_ORDER_LINE_ITEMS` ' at line 3
11
1328
by: David Abrahams | last post by:
I'm pretty comfortable with Python, but recently I'm constantly finding mysterious issues with import. For example, looking at http://genshi.edgewall.org/browser/trunk/genshi/filters/transform.py the examples use the symbol 'HTML' but it's not defined locally, it's not explicitly imported, and there's no import *. Yet doctest will test this module and it passes with flying colors. It turns out HTML is defined in genshi.input. How...
1
2765
by: grbgooglefan | last post by:
I am importing cStringIO module in my PythonC++ embedded program. The import is failing with the following error: ImportError: /usr/lib/python2.3/lib-dynload/cStringIO.so: undefined symbol: PyObject_SelfIter I have python-2.3.3-88.9.x86 installed on my machine. Why is this error coming? how can I resolve this undefined symbol? Do I need to import anything before this?
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.