Compare commits
2 Commits
b9bf831001
...
master
Author | SHA1 | Date | |
---|---|---|---|
17e5f0d5dc | |||
7742235180 |
@@ -25,7 +25,7 @@ CREATE TABLE `book` (
|
|||||||
CREATE TABLE `dvd` (
|
CREATE TABLE `dvd` (
|
||||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`product_id` int unsigned NOT NULL,
|
`product_id` int unsigned NOT NULL,
|
||||||
`size` int unsigned NOT NULL,
|
`size` float NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `dvd_UN` (`product_id`),
|
UNIQUE KEY `dvd_UN` (`product_id`),
|
||||||
CONSTRAINT `dvd_FK` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
|
CONSTRAINT `dvd_FK` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`)
|
||||||
|
@@ -74,7 +74,7 @@ class DVD extends Product
|
|||||||
$size = $this->getSize();
|
$size = $this->getSize();
|
||||||
|
|
||||||
$stmt = $conn->prepare("INSERT INTO ".DVD." (product_id, size) VALUES (?, ?);");
|
$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) {
|
if ($stmt->execute() === true) {
|
||||||
$this->setVariationId($conn->insert_id);
|
$this->setVariationId($conn->insert_id);
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="price">Price ($)</label></td>
|
<td><label for="price">Price ($)</label></td>
|
||||||
<td><input type="number" id="price" name="price" required></td>
|
<td><input type="text" id="price" name="price" required></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user