PDA

View Full Version : Problem inserting into MySQL



mobilebadboy
04-29-2004, 04:33 PM
Can anyone figure out what's wrong with these 3 entries that would make them not insert? "MySQL said 'Change database in DBManager'". It's inserted (manually) 56 others just fine. There are over 4000 entries, so I'd like to not have to manually trial and error this. :eek:



INSERT INTO `gear3` VALUES (10, 'Abilene Bronze Acoustic Guitar Strings Medium ', 'Abilene acoustic guitar strings are formulated to deliver a rich and vibrant live performance. Every set utilizes premium alloys to enhance longevity and tonal alloys to enhance longevity and tonal to meet the exacting specification for each individual gauge. Each string is individually sealed to protect it from oxidation -- insuring untarnished performance with every set. You\'ll hear and feel the difference. ', 'ABLASMD', 'http://www.zzounds.com/a--304324/item--ABLASMD', 'http://media.zzounds.com/media/feed/small/ABLASMD.jpg', 'http://media.zzounds.com/media/feed/large/ABLASMD.jpg', '2.49', '', '9.95', 'Acoustic Guitar Strings 6 Strings', 'Abilene', '4.99');



INSERT INTO `gear3` VALUES (36, 'Akai EB4JS 56 Bit 4 Channel Effects Processor', 'With this effects option, the Z8/Z4 features four 24-bit/96 kHz multi-effects processors, offering a whole host of FX types, including reverbs, delays, modulation-based FX, dynamics, wah-wah, and pitch shifting. FX can be applied while sampling, re-sampling, or in Multi mode. In addition to the various FX types, Quick-FX presets such as Power, Swell, and Crisp provide an intuitive way to apply FX. When you use Multis, you can adjust FX parameters via the Q-Link control in real time.', 'AKAEB4JS', 'http://www.zzounds.com/a--304324/item--AKAEB4JS', 'http://media.zzounds.com/media/feed/small/AKAEB4JS.jpg', 'http://media.zzounds.com/media/feed/large/AKAEB4JS.jpg', '219.95', '', '279.00', 'Multieffects Processors', 'Akai', '0');



INSERT INTO `gear3` VALUES (59, 'Akai MFC42KIT Mounts MFC42 to MPC2000XL', 'Use this mouting kit to attach your MFC42 filer option to any of the MPC2000XL Series.', 'AKAMFC42KIT', 'http://www.zzounds.com/a--304324/item--AKAMFC42KIT', 'http://media.zzounds.com/media/feed/small/AKAMFC42KIT.jpg', 'http://media.zzounds.com/media/feed/large/AKAMFC42KIT.jpg', '84.95', '', '99.00', 'Keyboard Rackmount Accessories', 'Akai', '4.99');

Chris
04-29-2004, 05:49 PM
I've never seen that MySQL error before, sorry.

mobilebadboy
04-30-2004, 12:09 AM
Me either. I don't understand why it'll accept some and then errors on others.

Oh well. That's the first and last time I buy a site from someone.

Chris
04-30-2004, 05:55 AM
Could you try inserting with PhpMyAdmin, just in the manual way (where you click insert and it gives you form fields).

mobilebadboy
04-30-2004, 02:29 PM
Yeah if I do it that way it takes them just fine, and it accepts a few at a time if I just run an SQL query. But then I keep hitting the error. So I go in and insert them manually until I get past whichever one was giving the error.

If it was just 100 or 200 entries, it wouldn't bother me as bad. I got 118 in last night doing it that way. But there's 4669 of them, and the frustration is setting in rapidly. This is the first time I've ever had a problem importing database information, be it my own or from someone else.

Westech
05-01-2004, 12:52 PM
One of the strings in the first query has an appostrophe in it (You'll.) If you don't have magic quotes on or escape it somehow this could cause a problem. I'm not sure what's wrong with the rest of them.

sting
05-01-2004, 06:00 PM
I am getting the same error on one of the sites I manage - any luck in finding a pattern? It's not just the apostrophe's as far as I can tell.

-sting

sting
05-01-2004, 06:54 PM
I haven't decided if its key word or what. I did narrow it down in one of my tables to one field causing the problem, but I can't seem to figure out why it is causing the problem.

If I try this statement:

INSERT INTO nuke_groups VALUES ( "3", "The Community", "", "100"); It works fine.

But the original statement was

INSERT INTO nuke_groups VALUES ( '3', 'The Community', 'A Peer to Peer Community of persons who use the website to exchange information. 100 plus points!', '100');

The table structure on that field calls for
description text NOT NULL,

Its got me wondering, thats for sure.

-sting

sting
05-01-2004, 07:11 PM
Update.

I started wondering even more, and tested two restore statements - one on the Dbmanager site, and another on a completely separate site that uses Vdeck and phpMyadmin.

The DbManage site gave me the error each time.

The vdeck site worked flawlessly. I have a suspicion this is a bug in DBManage or whatever that thing is called.

-sting

jimhuber
05-10-2004, 11:18 AM
I am having the same problem too with DBManager.

I narrowed it down to, in one of the rejected inserts' text fields, the word "because". So I escaped all the becauses (something like b\ecause.) and that helped with those inserts.

But there are more problem words out there, as your examples show.

Jim

mobilebadboy
05-10-2004, 08:16 PM
I believe my host updated the software or something, although they never did respond back to me which is odd. But a few days ago I tried again just for the hell of it and everything inserted without one incident. And I have since wiped the DB and inserted an entire new version of the datafeed (no MySQL elements, just tabbed delimeters) and didn't have one problem with that either.