News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Error importing data in DB

Started by edi67, September 09, 2008, 07:28:55 AM

Previous topic - Next topic

edi67

One question, i trying to import one line of data in one my table ( personal_message) well going on SQL windo in my DB and launching the line:

INSERT INTO `personal_messages` (`id_pm`, `id_pm_head`, `id_member_from`, `deleted_by_sender`, `from_name`, `msgtime`, `subject`, `body`) VALUES
(2450, 2450, 158, 1, 'ciccio69', 1220896345, 'BEIJING 2008 OLYMPICS GAME - Informazioni sul prod', 'Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?'),


Return me back this error:
QuoteError

query SQL:

INSERT INTO `personal_messages` ( `id_pm` , `id_pm_head` , `id_member_from` , `deleted_by_sender` , `from_name` , `msgtime` , `subject` , `body` )
VALUES ( 2450, 2450, 158, 1, 'ciccio69', 1220896345, 'BEIJING 2008 OLYMPICS GAME - Informazioni sul prod', 'Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?' ) ,

Messaggio di MySQL: Documentazione
#1064 - 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 '' at line 2

why this error? line that i awant insert i took directly esporting from DB 5 minutes before to add, i wanted only try to see if import/export work, but i cannot understand where is the mistake

some solution?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Oldiesmann

Try getting rid of the ` marks around the table names - sometimes that can cause the error you're getting.
Michael Eshom
Christian Metal Fans

edi67

Quote from: Oldiesmann on September 11, 2008, 08:52:35 PM
Try getting rid of the ` marks around the table names - sometimes that can cause the error you're getting.

I trying in this way:
INSERT INTO personal_messages ( id_pm , id_pm_head , id_member_from , deleted_by_sender , from_name , msgtime , subject , body )
VALUES ( 2450, 2450, 158, 1, 'ciccio69', 1220896345, 'BEIJING 2008 OLYMPICS GAME - Informazioni sul prod', 'Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?' ) ,


but i have the same error :( very strange.... some more solution?

that line i took directly from backup, i cannot understand this my DB save in that way but cannot resotre using same data?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Rumbaar

Try using double quotes instead of single quotes.
INSERT INTO personal_messages ( id_pm , id_pm_head , id_member_from , deleted_by_sender , from_name , msgtime , subject , body )
VALUES ( 2450, 2450, 158, 1, "ciccio69", 1220896345, "BEIJING 2008 OLYMPICS GAME - Informazioni sul prod", "Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?" ) ,
"An important reward for a job well done is a personal sense of worthwhile achievement."


[ Themes ]

edi67

Quote from: Rumbaar on October 02, 2008, 11:42:47 PM
Try using double quotes instead of single quotes.
INSERT INTO personal_messages ( id_pm , id_pm_head , id_member_from , deleted_by_sender , from_name , msgtime , subject , body )
VALUES ( 2450, 2450, 158, 1, "ciccio69", 1220896345, "BEIJING 2008 OLYMPICS GAME - Informazioni sul prod", "Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?" ) ,


Donw but... same error :(
Errore

query SQL:

INSERT INTO personal_messages( id_pm, id_pm_head, id_member_from, deleted_by_sender, from_name, msgtime, subject, body )
VALUES ( 2450, 2450, 158, 1, "ciccio69", 1220896345, "BEIJING 2008 OLYMPICS GAME - Informazioni sul prod", "Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?" ) ,

Messaggio di MySQL: Documentazione
#1064 - 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 '' at line 2
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Rumbaar

Ah it's the comma after the closing bracket.

Try:
INSERT INTO personal_messages ( id_pm , id_pm_head , id_member_from , deleted_by_sender , from_name , msgtime , subject , body )
VALUES ( 2450, 2450, 158, 1, "ciccio69", 1220896345, "BEIJING 2008 OLYMPICS GAME - Informazioni sul prod", "Ciao edi volevo delle informazioni in più.<br />Grazie<br />Possibile in megaupload?" )

Note you're missing the db prefix as well to the personal_messages table.
"An important reward for a job well done is a personal sense of worthwhile achievement."


[ Themes ]

edi67

Quote from: Rumbaar on October 03, 2008, 08:53:15 AM
Ah it's the comma after the closing bracket.

Oh my god that was the problem...... leaving the bracket everything is ok...
Thx and sorry for this my silly mistake

Thx very much for your help guys.
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Advertisement: