· 7 years ago · Nov 30, 2018, 08:40 AM
1I have a directory of services where each service may contain several images in my form to add service I can choose how many images you want to upload. My problem is that when the service unless it is saved correctly in the table but the images do not simply do not save.
2And then someone has a solution? ;/
3
4My table structure in database is:
5
6Table images:
7
8CREATE TABLE IF NOT EXISTS `images` (
9 `id` int(8) unsigned NOT NULL AUTO_INCREMENT,
10 `filename` varchar(255) DEFAULT NULL,
11 `created` datetime DEFAULT NULL,
12 `modified` datetime DEFAULT NULL,
13 `service_id` int(11) NOT NULL,
14 PRIMARY KEY (`id`)
15) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
16
17Table services:
18
19CREATE TABLE IF NOT EXISTS `services` (
20 `id` int(11) NOT NULL AUTO_INCREMENT,
21 `title` varchar(255) NOT NULL,
22 `content` text NOT NULL,
23 `active` varchar(10) NOT NULL,
24 `featured` varchar(10) NOT NULL,
25 `created` datetime NOT NULL,
26 `modified` datetime NOT NULL,
27 `user_id` int(11) NOT NULL,
28 PRIMARY KEY (`id`)
29) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;