Thread: Mysql error
View Single Post
Old 03-10-2009, 10:45 PM   #4 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

Without knowing the type like etoolbox said it's kind of hard.
If it is a primary key, it is not safe to leave it a null, so the record is not created. That could be the reason.
If the image_id is set to auto_increment, you don't need to make an explicit insert with that field, something like this would work:

Code:
INSERT INTO images(image_productid, image_src, image_front)
VALUES ('', 'includes/images/palmyra10sl.jpg', '')
But I might be wrong, I just finished a project working with Access SQL so that might not be right. If that is not right try to save the default value like this:

Code:
INSERT INTO images(image_id, image_productid, image_src, image_front)
VALUES (DEFAULT, '', 'includes/images/palmyra10sl.jpg', '')
I am no expert in mysql though, this is just speculations, but maybe it would help.
tony is offline  
Reply With Quote