AJAX - Grid: Prepare Table Grid


AJAX Grid Step By Step Tutorial 1: In this tutorial, we will create a table data that use AJAX. Before follow it, please read basic tutorial: AJAX Client and AJAX PHP.

For practice, we will make book catalog. Final result like this:

First, we prepare database. Create database named "test" (if don't exist).

Next, create table named "books". You can use phpmyadmin for create it. Or you can execute this query:

CREATE TABLE `books` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(150) NOT NULL,
  `author` varchar(150) NOT NULL,
  `description` varchar(255) NOT NULL,
  `on_sale` tinyint(1) NOT NULL,
  PRIMARY KEY  (`id`)
)

Try to insert several data:

INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (1, 'PHP AJAX', 'Andreas', 'This is good book for learning AJAX', 1);
INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (2, 'PHP Eclipse ', 'George', 'Nice book', 0);
INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (3, 'PHP Prado', 'Junyian', '-', 1);
INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (4, 'PHP Zend Framework', 'Ozulian', 'great', 0);
INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (5, 'PHP Web Services', 'Bobi', '', 0);
INSERT INTO `books` (`id`, `title`, `author`, `description`, `on_sale`) VALUES (6, 'PHP API', 'Hugo', '', 1);


Series this article:
AJAX - Grid: Prepare Table Grid
AJAX - Grid: Creating Server Side Task
AJAX - Grid: Testing Server Side Task
AJAX - Grid: Creating XSL for Client Side
AJAX - Grid: Creating JavaScript for Client Side
AJAX - Grid: Creating Page for Final Display

Bookmark and Share Tag: ajax, grid, table Category: PHP Application Post : March 27th 2008 Read: 30,727

advertisements


blog comments powered by Disqus