CONTOH LATIHAN CI.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Filegroup “Stage A” Filegroup “Stage A” Filegroup “A” Partition 1,2 Filegroup “B” Partition 3,4 Filegroup “C” Partition 5,6 Filegroup “D” Partition.
Keys, Referential Integrity and PHP One to Many on the Web.
PHP and MySQL Database. Connecting to MySQL Note: you need to make sure that you have MySQL software properly installed on your computer before you attempt.
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
PHP –Writing Reusable Code 10 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
NMED 3850 A Advanced Online Design February 25, 2010 V. Mahadevan.
The Watson Game Database Group Members: Joshua Shapiro - Team leader Dan Dauchy - MySQL table creation scripts Andy Modansky - MySQL data transfer script.
INTRODUCTION The Group WEB BROWSER FOR RELATION Goals.
Manipulating MySQL Databases with PHP. PHP and mySQL2 Objectives Connect to MySQL from PHP Learn how to handle MySQL errors Execute SQL statements with.
PHP on a Fast Track a quick introduction to PHP programming by Jarek Francik.
What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables. A table is a collections of related data entries and.
PHP1-1 PHP & SQL Xingquan (Hill) Zhu
Website Security ISYS 475. Authentication Authentication is the process that determines the identity of a user.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
Sayed Ahmed Computer Engineering, BUET, Bangladesh MSC, Computer Science, U of Manitoba, Canada
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Comp4711 – Internet Development CodeIgniter Cookbook Comp4711 #2 – Sept 14, 2011.
PHP MySQL. SQL: Tables CREATE TABLE tablename { fieldname type(length) extra info,... } Extra info: –NULL (allows nulls in this field) –Not NULL (null.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
MySQL PHP Web Technology. Logging in to Command Line Start -> Programs -> AppServ -> MySQL Command Line Client Enter Password, then you’ll be working.
Lecture 10 – MYSQL and PHP (Part 2)
Welcome to the Web! Session By: Infero - Programming Club, IIT Hyderabad.
CAKEPHP Blog tutorial. what you’ll need examples/blog/blog.html 2  A running web server  A database server.
PHP with MySQL 1.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
Truckee River Information Gateway TRIG Training Session Sept. 13, 2006 David Waetjen Information Center for the Environment (ICE)
Summary 1 Gordon Tian CS520/CS596_026. HTTP Browser – Chrome | FireFox XML/HTML/CSS3/JavaScript/REST Web Server – Nginx PHP/Python/Perl/Java/Ruby/Node.js.
Creating A Database Driven Website 1.Setting Up Your Web Server 2.Creating a Database 3.Creating a Webpage to Display Information From a Database 4.Creating.
NMED 3850 A Advanced Online Design January 14, 2010 V. Mahadevan.
Database MySQL Universitas Muhammadiyah Surakarta Yogiek Indra Kurniawan.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
CHAPTER 10 PHP MySQL Database
SQlite. SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation.
Nic Shulver, Storing Data on the Server Introduction We are going to look at some working code It writes fixed data into a simple.
Web Systems & Technologies
PHP using MySQL Database for Web Development (part II)
PHP Built-In Functions
Pertemuan 5 Login Dan session.
CodeIgniter Form & Login
Introduction to Dynamic Web Programming
Unix System Administration
Introduction to PHP and MySQL – Creating Database-Driven Websites
1. CodeIgniter – Overview
SIMPLE XML ELEMENT Disusun oleh : Tora Fahrudin., M.T
PHP: Login FdSc Module 109 Server side scripting and Database design
PHP: Inserting data FdSc Module 109 Server side scripting and
PHP Arrays Functions.
Web Technologies PHP 5 Basic Language.
Storing Images Connect to the server using the correct username and password. $conn = mysql_connect(“yourserver”, “joeuser”, “yourpass”); Create the database.
Introduction to CodeIgniter (CI)
Server-Side Application and Data Management IT IS 3105 (FALL 2009)
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Introduction to Web programming
Objectives Connect to MySQL from PHP Learn how to handle MySQL errors
MySQL tutorial.
PDO Database Connections: Getting data out of the database
Introduction to Web programming
MySQL Web Application Connecting to a MySQL database
SQL Code for Byrnetube video
PHP: Database connection
Error and Exception Handling
Web Programming– UFCFB Lecture
MySQL Web Application Connecting to a MySQL database
Introduction to Web programming
Conection
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
Presentation transcript:

CONTOH LATIHAN CI

Application/confiq-> CONFIQ.PHP $config['base_url'] = 'http://localhost/latihan_ci/'; $config['index_page'] = ''; Application/confiq-> AUTOLOAD.PHP $autoload['libraries'] = array('database'); $autoload['helper'] = array('form','url');

Application/View-> DATABASE.PHP $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'latihan_ci', '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

Localhost/phpmyadmin  Table: BARANG Localhost/phpmyadmin  Table: latihan_ci Localhost/phpmyadmin  Table: BARANG CREATE TABLE IF NOT EXISTS `barang` ( `kode_barang` varchar(5) NOT NULL, `nama_barang` text NOT NULL, `harga` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; MASUKKAN DATA INSERT INTO `barang` (`kode_barang`, `nama_barang`, `harga`) VALUES ('BR001', 'SEMINGGU MENGUASAI CODEIGNITER', 90000), ('BR002', 'MEMBUAT WEB APLIKASI DENGAN PHP, MYSQLI DAN BOOSTRAP', 95000);

Application/View-> MODEL_BARANG.PHP <?php class Model_Barang extends CI_Model{ function list_barang(){ // ambil data barang dari tabel barang $barang=$this->db->get('barang'); return $barang; } function product($kode_barang){ return $this->db->get_where('barang', array('kode_barang'=>$kode_barang)); ?>

Application/View-> BARANG.PHP <?php class barang extends CI_Controller{ function index() { $this->load->model('model_barang'); $judul ="Daftar Barang"; $data['judul']=$judul; $data['barang']=$this->model_barang->list_barang()->result(); $this->load->view('list_barang',$data); } function input() { $this->load->view('input_barang'); function input_simpan() { $databarang=array( 'kode_barang' =>$this->input->post('kode_barang'), 'nama_barang' =>$this->input->post('nama_barang'), 'harga' =>$this->input->post('harga_barang')); $this->db->insert('barang',$databarang); redirect('barang'); ?>

Application/View-> LIST_BARANG.PHP <?php echo $judul; ?> <?php echo anchor('barang/input','INPUT DATA BARANG'); ?> <hr> <table border="1"> <tr><th>KODE BARANG</th><th>NAMA BARANG</th><th>HARGA</th><th colspan=2>ACTION</th></tr> <?php foreach ($barang as $b) { echo "<tr> <td>$b->kode_barang</td> <td>$b->nama_barang</td> <td>$b->harga</td> <td>".anchor('barang/edit/'.$b->kode_barang,'EDIT')."</td> <td>".anchor('barang/delete/'.$b->kode_barang,'DELETE')."</td> </tr>"; } ?> </table>