In the previous parts of this tutorial series we have discussed how to setup the application environment using XAMPP and CodeIgniter, and the application specification. We have done the analysis and design using UML use case and class diagram with free UML diagram tool StarUML.
In this part, we will discuss the database design for our application. This database is needed to hold the data for our application.
We are going to draw the entity relationship diagram (ERD) using a free tool called MySQL workbench, formerly fabForce ERD tools for MySQL. Before continuing, please download the program here and install it to your computer.
At the end of the designing process, we will create our database structure directly to a MySQL server that can be used by our application.
Read more…
This article explain how to transpose a MySQL table from row to column. Suppose that you have a sales table per item per retail outlet per sales date like this:
Then, you need to show the total sales per item per retail outlet like the following:
Read more…
Image by lilit via Flickr
Dalam konteks bahasa SQL, pada umumnya informasi tersimpan dalam tabel-tabel yang secara logik merupakan struktur 2 dimensi yang terdiri dari baris-baris data (row atau record) yang berada dalam satu atau lebih kolom (column). Baris pada tabel sering disebut sebagai instance dari data sedangkan kolom sering disebut sebagai attributes atau field. Read more…
This simple PHP script can be used to backup MySQL databases and then send the zipped backup file to email addresses. The backup file can then be restored by any MySQL front end program like the mysql command line, Navicat MySQL, or phpMyAdmin.
The logic of the script is really simple:
- initialization
- create backup sql file
- zip the file
- send email
Read more…
Backing up and Restoring mysql database could be done through several ways. You can backup and restore by exporting SQL script using MySQL command line or copying MySQL data directory from the original server to the destination server.
Using the second method will cause the stored procedure and function missing. In this article we will discuss how to overcome the situation.
Read more…
Pada kondisi dimana user minta bisa mencoba aplikasi yang kita bangun menggunakan WAMP (Windows Apache MySQL PHP) dan belum terdapat server komputer yang dapat kita installkan infrastruktur yang dibutuhkan, kita dapat menggunakan portable WAMP yang dapat dijalankan dari USB.
Kondisi lainnya adalah ketika kita ingin membuat versi trial aplikasi web kita ke calon customer.
Salah satu yang dapat digunakan adalah USB Webserver (http://www.usberbserver.nl). Aplikasi ini berisi Apache, PHP, dan MySQL yang telah dikonfigurasi dan siap dijalankan sehingga kita tinggal mengisi aplikasi web yang akan kita demokan ke client.
Read more…
Categories: Apache, MySQL, PHP, Windows Tags: Apache, apache mysql, apache php, drive usb, MySQL, PHP, port 8080, portable, server smtp, settingan, usb, usb webserver, wamp
Secara default, database driver MySQL CodeIgniter konek ke port default MySQL yaitu 3306. Pada kondisi dimana port MySQL bukan 3306 misalnya 3307, CodeIgniter tidak punya option untuk menentukan pada port berapa MySQL berjalan.
Solusi untuk hal ini dapat dilakukan dengan beberapa cara:
- mengedit file driver database CodeIgniter: system/database/drivers/mysqli/mysqli_driver.php. Pada file ini dapat ditentukan port MySQL pada function ‘db_connect’ yaitu dengan menambahkan parameter $port pada function tsb:
mysqli_connect ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] )
- mengedit file PHP.INI, pada bagian mysql.default_port, ganti dari 3306 menjadi 3307
- jika tidak punya akses ke file PHP.INI, bisa juga dicoba dengan mengedit file config/database.php nya CodeIgniter yaitu pada baris:
$db['default']['hostname'] = "mysqlhost.yourdomain.com:3307";
Categories: CodeIgniter, MySQL, PHP Tags: CodeIgniter, connect, database, database driver, database drivers, driver database, file, file ini, koneksi, MySQL, PHP, port, string
phpMyBackupPro is a tool created using PHP programming language that can be used to perform backup and restore on MySQL database server. In this article we are going to learn how to install and configure this tool, perform manual backup and then perform restore the previously backed up database. We will also learn how to setup an automatic periodic backup using the same tool.
Installation
Installation of this tool is simple. Just download the newest version from http://www.phpmybackuppro.net/download.php.
After downloading, extract the zip file to a directory on your PHP and Apache web server accessible from browser, ie the Document Root, for example C:\XAMPP\HTDOCS. Then you will get a new folder under it, for example C:\XAMPP\HTDOCS\phpMyBackupPro.
That’s it! Now go to your web browser and point the URL of phpMyBackupPro, for example http://localhost/phpMyBackupPro.
Read more…
Categories: MySQL, PHP, Windows Tags: apache web server, backup, browser ie, database, database info, directory, file, manual backup, MySQL, mysql password, periodic, PHP, restore, script, Select, sql command, sql data, table, task, xampp
Recent Comments