Change size column to float type

This commit is contained in:
Augusto Gunsch 2022-07-29 12:35:29 +02:00
parent 7742235180
commit 17e5f0d5dc
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ CREATE TABLE `book` (
CREATE TABLE `dvd` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`product_id` int unsigned NOT NULL,
`size` int unsigned NOT NULL,
`size` float NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `dvd_UN` (`product_id`),
CONSTRAINT `dvd_FK` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)

View File

@ -74,7 +74,7 @@ class DVD extends Product
$size = $this->getSize();
$stmt = $conn->prepare("INSERT INTO ".DVD." (product_id, size) VALUES (?, ?);");
$stmt->bind_param('ii', $productId, $size);
$stmt->bind_param('id', $productId, $size);
if ($stmt->execute() === true) {
$this->setVariationId($conn->insert_id);