There are different ways of uploading image in database in php. The below code is uploading the image and instead of keeping the image in database, it sets the location of image in database e.g: image/gallery/picture1.jpg . The advantage of this approach is that, it reduces the load in database by reducing the size from image size to text size(instead of uploading images, it upload path to that image). Below is a working code for uploading image.
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Saturday, January 17, 2015
Sunday, July 6, 2014
How to insert data into database ?
In our previous section, we show you how to connect to database in php. In this post, we will show you how to insert data into database. require 'connect.php'; imports the php file which has been already defined. Its demo is shown here. The $_POST['username'] and $_POST['password'] takes value of input value in html form. Then, "if($u_pass !=
Wednesday, July 2, 2014
Connect to mysql database in php
$mysql_host = "localhost";
$mysql_user = "root";
$mysql_pass = "";
$mysql_db = "courses";
$mysql_user = "root";
$mysql_pass = "";
$mysql_db = "courses";
Labels:
php
Subscribe to:
Posts (Atom)