requinix wrote:It means there's already a row in the table with products_model=
"". And this isn't allowed because somewhere you told MySQL that there cannot be duplicates in that column.
Which means that yes, you probably haven't set up the table correctly. What does
output, and can you explain how the table is supposed to be used? (Or point out someplace that you might have already done so.)
you replied with product_model="" is that because you don't know what should the inside be?
On the other had, the error message had only one quotation mark.
That means the program must be wrong somewhere.....
That is the system program program categories.php for OSC administration for puting/update products.
I did not intentionally changed that part. If there is error must be typo or cause by other modification.
The create table is
====================
drop table if exists `products`;
CREATE TABLE `products` (
`products_id` int(11) NOT NULL AUTO_INCREMENT,
`products_quantity` int(4) NOT NULL,
`products_model` varchar(13) DEFAULT NULL,
`products_image` varchar(64) DEFAULT NULL,
`products_price` decimal(15,4) NOT NULL,
`products_date_added` datetime NOT NULL,
`products_last_modified` datetime DEFAULT NULL,
`products_date_available` datetime DEFAULT NULL,
`products_weight` decimal(5,2) NOT NULL,
`products_status` tinyint(1) NOT NULL,
`products_tax_class_id` int(11) NOT NULL,
`manufacturers_id` int(11) DEFAULT NULL,
`products_ordered` int(11) NOT NULL DEFAULT '0',
`products_type` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`products_id`),
UNIQUE KEY `products_model` (`products_model`),
KEY `idx_products_model` (`products_model`),
KEY `idx_products_date_added` (`products_date_added`)
);
====================
CREATE TABLE `products` (
`products_id` int(11) NOT NULL AUTO_INCREMENT,
`products_quantity` int(4) NOT NULL,
`products_model` varchar(13) DEFAULT NULL,
`products_image` varchar(64) DEFAULT NULL,
`products_price` decimal(15,4) NOT NULL,
`products_date_added` datetime NOT NULL,
`products_last_modified` datetime DEFAULT NULL,
`products_date_available` datetime DEFAULT NULL,
`products_weight` decimal(5,2) NOT NULL,
`products_status` tinyint(1) NOT NULL,
`products_tax_class_id` int(11) NOT NULL,
`manufacturers_id` int(11) DEFAULT NULL,
`products_ordered` int(11) NOT NULL DEFAULT '0',
`products_type` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`products_id`),
UNIQUE KEY `products_model` (`products_model`),
KEY `idx_products_model` (`products_model`),
KEY `idx_products_date_added` (`products_date_added`)
) TYPE=MyISAM CHARACTER SET=utf8;
================================================
The laterone is what I created, the first one is the backup version. They should be the same.
Strangly, the last line about character set is alyaws not
included in the backup? Perhapse a problem of the backup program?