SlideShare a Scribd company logo
jQuery/HTML5 and PHP CRUD

      Sample of my work
      By Daniel Bertrand
The problem
• Javascript is client-side.
• PHP is server-side.




• We need a system to connect both together.
•   Jquery can call an external page using ajax:



•   $.post('removeRec.php',{ID:row.ID},function(){
      – $('#dg').datagrid('deleteRow',index);
•   })

•   removeRec.php connects to the database with the proper credentials:

•   <?php
•   $ID = $_REQUEST['ID'];
•   include 'conn.php'; // connect to the database
•   $sql = "DELETE FROM [dbo].[myTable] WHERE ID='$ID'";
•   $result = @mssql_query($sql);
•   echo json_encode(array('success'=>true));
•   ?>

•   The last line returns data back to the javascript caller in a JSON string. This is how we get back
    data from the database, and success/failure notifications.
• My CRUD application using jeasyUI:
Dropdown boxes to make input faster…
• Tools I use:

•   PHP 5.4.4
•   - javaScript/jQuery 1.8.4
•   - jQuery Mobile 1.2
•   - jeasyUI
•   - geospatially-enabled mySQL
•   - MSSQL

More Related Content

PPT
Mysocial databasequeries
PPT
Mysocial databasequeries
PPTX
Magento Dependency Injection
PPTX
How my team is applying JS framework for PHP projects.
PDF
WordPress as an application framework
TXT
PPTX
Code Igniter 2
PPTX
15. CodeIgniter editarea inregistrarilor
Mysocial databasequeries
Mysocial databasequeries
Magento Dependency Injection
How my team is applying JS framework for PHP projects.
WordPress as an application framework
Code Igniter 2
15. CodeIgniter editarea inregistrarilor

What's hot (20)

PDF
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
DOCX
Font size
DOCX
javascript code for mysql database connection
PPTX
AngularJS Compile Process
PDF
Writing testable js [by Ted Piotrowski]
PPTX
AngularJS Services
PDF
Binding components, events + data sources in HTML + JS
PDF
Add edit delete in Codeigniter in PHP
PDF
Pagination in PHP
PDF
Country State City Dropdown in PHP
PDF
Migrating to-Drupal-8 by Bryan Manalo
PDF
Migrating Drupal 7 to Drupal 8
PPTX
AngulrJS Overview
DOCX
iMagine
PPTX
A2Lab - Payment Request API
KEY
Eu odeio OpenSocial
PPTX
State management
ZIP
Django at the Disco
PPTX
Template syntax in Angular 2.0
KEY
Web storage
Dicoding Developer Coaching #27: Android | Membuat Aplikasi Support Online Ma...
Font size
javascript code for mysql database connection
AngularJS Compile Process
Writing testable js [by Ted Piotrowski]
AngularJS Services
Binding components, events + data sources in HTML + JS
Add edit delete in Codeigniter in PHP
Pagination in PHP
Country State City Dropdown in PHP
Migrating to-Drupal-8 by Bryan Manalo
Migrating Drupal 7 to Drupal 8
AngulrJS Overview
iMagine
A2Lab - Payment Request API
Eu odeio OpenSocial
State management
Django at the Disco
Template syntax in Angular 2.0
Web storage
Ad

Similar to Javascript Php Crud (20)

PPT
J query b_dotnet_ug_meet_12_may_2012
PPT
Tech talk php_cms
PPTX
introduction to backend with php 8.X - slide.pptx
PPS
Web technology html5 php_mysql
ODP
Codebits 2012 - Fast relational web site construction.
PDF
Php summary
PDF
PHP Course in pune , PHP Training in Pimpri chinchwad ,PHP training in Pune
DOC
SYED_PHPMYSQL_CV
PPTX
Amp and higher computing science
PPTX
CHAPTER six DataBase Driven Websites.pptx
PPTX
jQuery presentation
PDF
Web 11 | AJAX + JSON + PHP
PPT
JavaScript JQUERY AJAX
PDF
What's this jQuery? Where it came from, and how it will drive innovation
PPT
J query 01.07.2013.html
PPT
J query 01.07.2013
PPT
Chapter11 kkkkkkkkkkkkkkkkkkkkkkkk(1).ppt
PDF
Ditching jQuery Madison
PPTX
Overview to Data Transaction Management
PDF
Industrail training in php
J query b_dotnet_ug_meet_12_may_2012
Tech talk php_cms
introduction to backend with php 8.X - slide.pptx
Web technology html5 php_mysql
Codebits 2012 - Fast relational web site construction.
Php summary
PHP Course in pune , PHP Training in Pimpri chinchwad ,PHP training in Pune
SYED_PHPMYSQL_CV
Amp and higher computing science
CHAPTER six DataBase Driven Websites.pptx
jQuery presentation
Web 11 | AJAX + JSON + PHP
JavaScript JQUERY AJAX
What's this jQuery? Where it came from, and how it will drive innovation
J query 01.07.2013.html
J query 01.07.2013
Chapter11 kkkkkkkkkkkkkkkkkkkkkkkk(1).ppt
Ditching jQuery Madison
Overview to Data Transaction Management
Industrail training in php
Ad

Javascript Php Crud

  • 1. jQuery/HTML5 and PHP CRUD Sample of my work By Daniel Bertrand
  • 2. The problem • Javascript is client-side. • PHP is server-side. • We need a system to connect both together.
  • 3. Jquery can call an external page using ajax: • $.post('removeRec.php',{ID:row.ID},function(){ – $('#dg').datagrid('deleteRow',index); • }) • removeRec.php connects to the database with the proper credentials: • <?php • $ID = $_REQUEST['ID']; • include 'conn.php'; // connect to the database • $sql = "DELETE FROM [dbo].[myTable] WHERE ID='$ID'"; • $result = @mssql_query($sql); • echo json_encode(array('success'=>true)); • ?> • The last line returns data back to the javascript caller in a JSON string. This is how we get back data from the database, and success/failure notifications.
  • 4. • My CRUD application using jeasyUI:
  • 5. Dropdown boxes to make input faster…
  • 6. • Tools I use: • PHP 5.4.4 • - javaScript/jQuery 1.8.4 • - jQuery Mobile 1.2 • - jeasyUI • - geospatially-enabled mySQL • - MSSQL