Giter VIP home page Giter VIP logo

codeigniter-upload's Introduction

codeigniter-upload

Codeigniter 3 – Upload file and insert data into database!

Basic Setup:

MYSQL PART:

Go to MySQL or open phpMyadmin and create a database name called 'codeigniter3' and then create a table called 'pictures'. I am attaching the table structure here:

CREATE TABLE `pictures` (
  `pic_id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `pic_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pic_desc` text COLLATE utf8_unicode_ci NOT NULL,
  `pic_file` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

MySQL part is over. No need to go to the database again.

CODEIGNITER CONFIGURATIONS:

  1. First, open the database.php file inside /codigniter3/application/config/database.php and change the mysql hostname, username and password as per your database server configuration:
$db['default'] = array(
	'dsn'	=> '',
	'hostname' => 'localhost',//change this as per your server
	'username' => 'root',//change this as per your server
	'password' => '', //change this as per your server
	'database' => 'codeigniter3',
	'dbdriver' => 'mysqli',
	'dbprefix' => '',
	'pconnect' => FALSE,
	'db_debug' => (ENVIRONMENT !== 'production'),
	'cache_on' => FALSE,
	'cachedir' => '',
	'char_set' => 'utf8',
	'dbcollat' => 'utf8_general_ci',
	'swap_pre' => '',
	'encrypt' => FALSE,
	'compress' => FALSE,
	'stricton' => FALSE,
	'failover' => array(),
	'save_queries' => TRUE
);
  1. Then, open config.php file inside /codigniter3/application/config/config.php and set the $config['base_url'] to $config['base_url'] = 'http://localhost/codeigniter3/';

codeigniter-upload's People

Contributors

agurchand avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.