Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ext JS Data-driven Application Design

You're reading from   Ext JS Data-driven Application Design Learn how to build a user-friendly database in Ext JS using data from an existing database with this step-by-step tutorial. Takes you from first principles right through to implementation.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781782165446
Length 162 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kazuhiro Kotsutsumi Kazuhiro Kotsutsumi
Author Profile Icon Kazuhiro Kotsutsumi
Kazuhiro Kotsutsumi
Arrow right icon
View More author details
Toc

Implementing the read and write processes using Ext Direct


From here, we will start to implement the processing of data being written and read concerning the form that we have made this far. We'll be using Ext Direct for this as well. Before we continue with the following implementation, there are a few points that you should amend. One of those is to add an ID to a session when you log in. Let's amend this now (source file: 08_implement_read_and_write_by_ext_direct/index.php):

....
"SELECT",
"    COUNT(id) as auth,",
"    users.id,", // <- add
"    users.email,",
....

Then, store the session ID:

....
$_SESSION["USERINFO"] = array(
    "id" => $row["id"], // <- add
    "email" => $row["email"],
    ....

Next, add session_start to the beginning of the router being used by Ext Direct. By doing this, you should be able to access the session with the method from each class (source file: 08_implement_read_and_write_by_ext_direct/php/router.php).

<?php
session_start(); // <-- add...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image