Archive

Archive for the ‘MySQL’ Category

Developing Web Based POS Application Using Ruby on Rails on Debian 5

September 7th, 2010 2 comments

In this article we will learn how to begin developing web applications using Ruby on Rails. First we setup the development environment, then develop a simple CRUD (create, read, update, delete) application using MySQL database, and deploy the application to Apache web server. An an example, we will develop a very simple point of sales (POS) application that consists only 3 tables: orders, order_details, and items.

 

Ruby on Rails Installation

Install Ruby if it’s not installed yet on your system:

# apt-get install  ruby1.8 ruby1.8-dev

 

Install Ruby Gem package management directly from Rubyforge since we need the newer version than version 1.3.1 that is shipped with Debian 5:

Read more…

  • Share/Bookmark

CodeIgniter Tutorial: [Creating Accounting Application] Part 3 ER Diagram and Creating Database

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…

  • Share/Bookmark

MySQL Transpose Row Into Column

Image representing MySQL as depicted in CrunchBase

Image via CrunchBase

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:

Original Sales Table

Then, you need to show the total sales per item per retail outlet like the following:

Read more…

  • Share/Bookmark
Categories: MySQL Tags: , ,

Menguasai Structured Query Language (SQL)

(My)SQL geek

Image by lilit via Flickr

Database, tabel, baris, dan kolom

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…

  • Share/Bookmark

MySQL Backup to Email

Image representing MySQL as depicted in CrunchBase

Image via CrunchBase

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:

  1. initialization
  2. create backup sql file
  3. zip the file
  4. send email

Read more…

  • Share/Bookmark
Categories: Linux, MySQL, PHP, Windows Tags: , ,

Restore MySQL database, stored procedure missing ?

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…

  • Share/Bookmark

Portable Apache, MySQL, PHP

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…

  • Share/Bookmark

CodeIgniter: koneksi ke port MySQL tertentu selain 3306

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:

  1. 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]]]]]] )
  2. mengedit file PHP.INI, pada bagian  mysql.default_port, ganti dari 3306 menjadi 3307
  3. 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";
  • Share/Bookmark

MySQL Backup with phpMyBackupPro

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…

  • Share/Bookmark
This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.