How to upload images, audio files, video files using single form and store their names in appropriate tables?
database
CREATE TABLE IF NOT EXISTS `photos` (
`id` bigint(12) NOT NULL AUTO_INCREMENT,
`name` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
)
CREATE TABLE IF NOT EXISTS `audios` (
`id` bigint(12) NOT NULL AUTO_INCREMENT,
`name` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
)
CREATE TABLE IF NOT EXISTS `videos` (
`id` bigint(12) NOT NULL AUTO_INCREMENT,
`name` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
)
form.php
<form enctype="multipart/form-data" name="file_upload" method="post" action="insert.php">
<input type="file" name="file" />
</form>