├── LICENSE ├── README.md ├── all_image.php ├── config.php ├── images.sql ├── index.php ├── insert.php └── style.css /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 JehanKandy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Image-Insert-to-mysql-Database 2 | Image Insert to MySQL Database using PHP 3 |

4 | 5 | ********important********* 6 | 7 | all files must be in same folder.
8 | otherwise system does not working
9 | 10 | 11 | **************************** 12 | for .sql file 13 |
14 | 1. run xampp server
15 | 2. open web browser and type localhost/dashboard
16 | 3. go to phpmyadmin on top right
17 | 4. create databese named login
18 | 5. then press create
19 | 6. in tool bar of phpmyadmin click import
20 | 7. on choose file, select login.sql file and click go

21 | **************

22 | 23 | 8 .on path -> xampp/htdocs create a new folder named student
24 | 9. copy and past all files on to above created folder
25 | 10. Now open new tab and type localhost/student
26 | 27 |



28 | ************ 29 | -------------------------------------------------------------------------------- /all_image.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | All Images 16 | 93 | 94 | 95 | Home 96 | 97 | 98 | 99 | 102 | 105 | 108 | 109 | 0){ 112 | while($row = mysqli_fetch_assoc($result)){ 113 | 114 | ?> 115 | 116 | 119 | 122 | 125 | 126 | 131 |
100 | Image ID 101 | 103 | Image Name 104 | 106 | Date 107 |
117 | 118 | 120 | 121 | 123 | 124 |
132 |

133 | image preview in next version 134 |

135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.0.3 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: 127.0.0.1 6 | -- Generation Time: Mar 16, 2022 at 10:09 AM 7 | -- Server version: 10.4.14-MariaDB 8 | -- PHP Version: 7.2.34 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `image` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `images` 28 | -- 29 | 30 | CREATE TABLE `images` ( 31 | `id` int(10) NOT NULL, 32 | `image1` varchar(255) NOT NULL, 33 | `time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() 34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 35 | 36 | -- 37 | -- Dumping data for table `images` 38 | -- 39 | 40 | INSERT INTO `images` (`id`, `image1`, `time`) VALUES 41 | (1, 'images.jpg', '2022-03-16 09:08:34'), 42 | (2, 'github.PNG', '2022-03-16 09:08:42'), 43 | (3, 'images.jpg', '2022-03-16 09:08:49'); 44 | 45 | -- 46 | -- Indexes for dumped tables 47 | -- 48 | 49 | -- 50 | -- Indexes for table `images` 51 | -- 52 | ALTER TABLE `images` 53 | ADD PRIMARY KEY (`id`); 54 | 55 | -- 56 | -- AUTO_INCREMENT for dumped tables 57 | -- 58 | 59 | -- 60 | -- AUTO_INCREMENT for table `images` 61 | -- 62 | ALTER TABLE `images` 63 | MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 64 | COMMIT; 65 | 66 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 67 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 68 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 69 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Image Input 8 | 9 | 10 | 11 |
12 |
13 |

14 | Image Insert to Mysql 15 |

16 |

17 | Using input typt as file 18 |

19 | 20 | 21 |

22 | Developed on 16 /3 / 2022 23 |

24 |

25 | With JehanKandy 26 |

27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /insert.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | image insert 26 | 27 | 28 | 29 | Back 30 |
31 |
32 |
33 | Image Insert 34 |
35 |
36 | 37 |


38 | 39 | 40 |
41 |
42 |
43 |
44 |
45 | 46 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap'); 2 | * { 3 | font-family: 'Poppins', sans-serif; 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | outline: none; 8 | border: none; 9 | text-decoration: none; 10 | } 11 | 12 | p { 13 | margin-top: 10px; 14 | font-size: 15px; 15 | color: #333; 16 | } 17 | 18 | p a { 19 | color: rgba(0, 155, 0, 0.68); 20 | } 21 | 22 | .container { 23 | min-height: 100vh; 24 | display: flex; 25 | align-items: center; 26 | justify-content: center; 27 | padding: 20px; 28 | padding-bottom: 60px; 29 | } 30 | 31 | .container .content { 32 | text-align: center; 33 | } 34 | 35 | .container .content h3 { 36 | font-size: 30px; 37 | color: #333; 38 | } 39 | 40 | .container .content h3 span { 41 | background: crimson; 42 | color: #fff; 43 | border-radius: 5px; 44 | padding: 0 15px; 45 | } 46 | 47 | .container .content h1 { 48 | font-size: 50px; 49 | color: #333; 50 | } 51 | 52 | .container .content h1 span { 53 | color: crimson; 54 | } 55 | 56 | .container .content p { 57 | font-size: 25px; 58 | margin-bottom: 20px; 59 | } 60 | 61 | .container .content .btn { 62 | display: inline-block; 63 | padding: 10px 30px; 64 | font-size: 20px; 65 | background: #333; 66 | color: #fff; 67 | margin: 0 5px; 68 | text-transform: capitalize; 69 | } 70 | 71 | .container .content .btn:hover { 72 | background: crimson; 73 | } 74 | 75 | .form-container { 76 | min-height: 100vh; 77 | display: flex; 78 | align-items: center; 79 | justify-content: center; 80 | padding: 20px; 81 | padding-bottom: 60px; 82 | background: #eee; 83 | } 84 | 85 | .form-container form { 86 | padding: 20px; 87 | border-radius: 5px; 88 | box-shadow: 0 5px 10px rgba(0, 0, 0, .1); 89 | background: #fff; 90 | text-align: center; 91 | width: 500px; 92 | } 93 | 94 | .form-container form h3 { 95 | font-size: 30px; 96 | text-transform: uppercase; 97 | margin-bottom: 10px; 98 | color: #333; 99 | } 100 | 101 | .form-container form input, 102 | .form-container form select { 103 | width: 100%; 104 | padding: 10px 15px; 105 | font-size: 17px; 106 | margin: 8px 0; 107 | background: #eee; 108 | border-radius: 5px; 109 | } 110 | 111 | .form-container form select option { 112 | background: #fff; 113 | } 114 | 115 | .form-container form .form-btn { 116 | background: #b0ebc4; 117 | color: rgb(25, 155, 75); 118 | text-transform: capitalize; 119 | font-size: 20px; 120 | cursor: pointer; 121 | } 122 | 123 | .form-container form .form-btn:hover { 124 | background: rgb(25, 155, 75); 125 | color: #fff; 126 | } 127 | 128 | .form-container form .form-reset { 129 | background: #cfcfcf; 130 | color: rgb(250, 250, 250); 131 | text-transform: capitalize; 132 | font-size: 20px; 133 | cursor: pointer; 134 | } 135 | 136 | .form-container form .form-reset:hover { 137 | background: rgb(122, 122, 122); 138 | color: #fff; 139 | } 140 | 141 | .form-container form p { 142 | margin-top: 10px; 143 | font-size: 20px; 144 | color: #333; 145 | } 146 | 147 | .form-container form p a { 148 | color: rgb(25, 155, 75); 149 | } 150 | 151 | .form-container form .error { 152 | margin: 10px 0; 153 | display: block; 154 | background: rgb(212, 76, 76); 155 | color: #fff; 156 | border-radius: 5px; 157 | font-size: 20px; 158 | padding: 10px; 159 | } 160 | 161 | span { 162 | border: none; 163 | background-color: rgb(15, 179, 15); 164 | border-radius: 10px; 165 | } 166 | 167 | button { 168 | background: #b0ebc4; 169 | color: rgb(25, 155, 75); 170 | text-transform: capitalize; 171 | font-size: 20px; 172 | cursor: pointer; 173 | border-radius: 10%; 174 | width: 25%; 175 | } 176 | 177 | button:hover { 178 | background: rgb(25, 155, 75); 179 | color: #fff; 180 | } --------------------------------------------------------------------------------