Wednesday 19 December 2012

jQuery : Make Ajax Call PHP Script with JSON Return

User experience plays a vital role in excellent web design. AJAX allows you to run server-side validations, form submission, data retrieval, and other server-side stuff in the background (asynchronously) without interfering with the existing page where the request was made. It's a beautiful thing, but best of all it's not very difficult to do.

JSON its self is JavaScript Object Notation and a lightweight data-interchange format.Beside that JSON generate text-based open standard that readable for human. In this time, we'll try using JSON for data transfers and JQuery library for the tool and make AJAX connection.

Assume that we have structure file as below :


So let's move on to the script.

1. html


    JSON JQuery
    
    


    
Nama :
Alamat :
 
Atribut yang sudah terset adalah :
Tuesday 18 December 2012

MySQL : Join Query

Cause lot of task in the office lately so I haven't had as much time to post any note, so here I would like to make a note about Join Query in MySQL.

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables. Tables in a database are often related to each other with keys. So we can get data easier to read as what we want.

Assume that we have table and we'll try to make a relation, we make a simple table which have structure as below :

Table user:
CREATE TABLE `user` (
`id_user` int(11) NOT NULL auto_increment,
`name` varchar(20) NOT NULL,
PRIMARY KEY  (`id_user`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Table user_description :
CREATE TABLE `user_description` (
`id_user` int(11) NOT NULL,
`address` varchar(50) NOT NULL,
`telephone` varchar(15) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Data :
INSERT INTO `user` (`id_user`, `name`) VALUES
(1, 'anto purwanto'),
(2, 'johnny'),
(3, 'kartikarina');
INSERT INTO `user_description` (`id_user`, `address`, `telephone`) VALUES
(1, 'cimahi', '082550435544'),
(2, 'cibiru', '022 7823413'),
(4, 'tubagus ismail', '022 66224325');

Copyright © 2012 Clighter | Powered by Blogger