Application note: SQL@CHIP Connecting the IPC@CHIP to a Database



Similar documents
INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

Server side scripting and databases

Installing Drupal 8 on Windows 7 with XAMPP. I am trying to install Drupal 8 on my Windows machine as a development system.

MySQL Quick Start Guide

CPE111 COMPUTER EXPLORATION

MOODLE Installation on Windows Platform

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 03 (Nebenfach)

E-Commerce: Designing And Creating An Online Store

equate Installation QUICK START GUIDE

SETTING UP AND RUNNING A WEB SITE ON YOUR LENOVO STORAGE DEVICE WORKING WITH WEB SERVER TOOLS

MySQL Quick Start Guide

Fairsail. Implementer. Fairsail to Active Directory Synchronization. Version 1.0 FS-PS-FSAD-IG R001.00

Project management integrated into Outlook

Livezilla How to Install on Shared Hosting By: Jon Manning

EOP ASSIST: A Software Application for K 12 Schools and School Districts Installation Manual

OrangeHRM Web Installation Guide for Windows

DIPLOMA IN WEBDEVELOPMENT

Online shopping store

Getting Started with Dynamic Web Sites

Oracle Database 10g Express

ClickCartPro Software Installation README

This installation guide will help you install your chosen IceTheme Template with the Cloner Installer package.

AJ Matrix V5. Installation Manual

Automated CPanel Backup Script. for home directory backup, remote FTP backup and Amazon S3 backup

Backup and Restore MySQL Databases

SQL Injection. Blossom Hands-on exercises for computer forensics and security

Installing buzztouch Self Hosted

Installation Instructions

Lucid Key Server v2 Installation Documentation.

How to install phpbb forum on NTU student club web server

Site Store Pro. INSTALLATION GUIDE WPCartPro Wordpress Plugin Version

MySQL quick start guide

The SkySQL Administration Console

PassMark Software BurnInTest Management Console. Quick start guide

The Whole OS X Web Development System

Labtech Learning Management System. Windows Installation. Standart Version 1.0

VP-ASP Shopping Cart Quick Start (Free Version) Guide Version 6.50 March

LT Auditor Windows Assessment SP1 Installation & Configuration Guide

RDS Migration Tool Customer FAQ Updated 7/23/2015

Build it with Drupal 8

Installation of PHP, MariaDB, and Apache

OpenEyes - Windows Server Setup. OpenEyes - Windows Server Setup

Add User to Administrators Group using SQL Lookup Table

The following steps detail how to prepare your database.

FileMaker 12. ODBC and JDBC Guide

CSCI110 Exercise 4: Database - MySQL

Witango Application Server 6. Installation Guide for OS X

IP Application Security Manager and. VMware vcloud Air

SYSTEM DEVELOPMENT AND IMPLEMENTATION

ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST

Webmail Using the Hush Encryption Engine

Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

Using a Remote SQL Server Best Practices

How To Backup A Database On A Microsoft Powerpoint 3.5 (Mysqldump) On A Pcode (Mysql) On Your Pcode On A Macbook Or Macbook (Powerpoint) On

FileMaker Server 11. FileMaker Server Help

PDshop.NET Installation Guides (ASP.NET Edition)

When choosing where to install and run the log analyzer, be aware that it requires access to the following log files:

Using ODBC with MDaemon 6.5

Approved SCOM Health Check Report Installation Guide

PHP+MYSQL, EASYPHP INSTALLATION GUIDE

FileMaker 13. ODBC and JDBC Guide

FileMaker Server 13. FileMaker Server Help

We begin with a number of definitions, and follow through to the conclusion of the installation.

Visual FoxPro Accessing MySQL. presented to The Atlanta FoxPro Users Group June 19 th, 2007

SQL Server Instance-Level Benchmarks with DVDStore

FileMaker Server 10 Help

Database Extension 1.5 ez Publish Extension Manual

FileMaker Server 14. Custom Web Publishing Guide

Web Hosting and Domain Name Registration

MYSQL DATABASE ACCESS WITH PHP

TIMETABLE ADMINISTRATOR S MANUAL

Equipment Room Database and Web-Based Inventory Management

FireBLAST Marketing Solution v2

Create e-commerce website Opencart. Prepared by : Reth Chantharoth Facebook : rtharoth@yahoo.

Transferring Your Hosting Account

Managing User Accounts

FileMaker Server 15. Custom Web Publishing Guide

Set Up Hortonworks Hadoop with SQL Anywhere

Web Development using PHP (WD_PHP) Duration 1.5 months

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

SECURING APACHE : THE BASICS - III

tpischeduler tpischeduler TotalFBO tpischeduler TotalFBO Initial Installation tpischeduler TotalFBO tpischeduler

Seamless Web Data Entry for SAS Applications D.J. Penix, Pinnacle Solutions, Indianapolis, IN

QTAKE HD and COPRA Version 1.2

How to Install and Setting Up Drupal

FileMaker Server 13. Custom Web Publishing with XML

Written by: Johan Strand, Reviewed by: Chafic Nassif, Date: Getting an ipath server running on Linux

TAMS Analyzer 3 and Multi-User Projects. By Matthew Weinstein

GravityLab Multimedia Inc. Windows Media Authentication Administration Guide

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE CISY 233 INTRODUCTION TO PHP

Transcription:

Application note: SQL@CHIP Connecting the IPC@CHIP to a Database 1. Introduction This application note describes how to connect an IPC@CHIP to a database and exchange data between those. As there are no database drivers for the IPC@CHIP, the connection is realized with a web server between the database and the IPC@CHIP. Due to that fact we have a universal solution for all databases that are accessible by a web server with PHP functionality. In this example, we use the MySQL database and the Apache web server. In addition, you need the belonging ZIP AN_sqlATchip.zip file with the PHP file and the C source code. 2. Requirements You need good knowledge of databases, the setup, maintenance and administration. Furthermore knowledge of running a web server (e.g. Apache) and PHP is needed. It is not possible to explain these topics in this application note. In order to keep the effort for this example as low as possible, we use XAMPP. XAMPP is an easy to install Apache web server distribution containing MySQL, PHP and Perl. XAMPP is easy to install and to use (just download, extract and start). 3. Data exchange How does it work? The data from and to the database will be transferred as follows: An application on the IPC@CHIP requests a web page (PHP) from the Apache web server. In this HTML GET request, the SQL statement is embedded in the GET variables and they are passed to the PHP web page. The PHP script extracts the SQL statement from the passed variables, starts a request to the

database and passes the results in a web page back to the IPC@CHIP. The application on the IPC@CHIP can parse this web page and can retrieve and process the requested data. This example provides a simple IPC@CHIP console application that queries the user for an ID. After retrieving the data from the database the application prints the received raw data to the console. 4. Procedure 4.1 Install XAMPP Download XAMPP from http://www.apachefriends.org/ and install it. Just follow the installation steps. There is also a lot of documentation on how to setup the web server and the database. After the installation, you can access the web server with a browser at http://127.0.0.1/ (local host). If you want to access the web server from another

computer you have to use the IP address of the computer hosting the Apache web server. Please place the PHP file wrapper.php from the ZIP file AN_sqlATchip.zip in a folder in your web server directory (e.g. htdocs/chip), so that the IPC@CHIP can call this file via the Apache web server. 4.2 Create a Database and table The easiest way to create a database is using phpmyadmin. phpmyadmin and its documentation are already installed with XAMPP on the Apache web server. For this example, please create a Database testdb containing a table testtable with three fields: testtable Fieldname Type 1 id int 2 name varchar(50) 2 firstname varchar(50)

After that, fill the table with some test data.

Finally create a user bob with password secret that has rights to read and write the table testtable. You find the rights management on the start page under privileges 4.3 sql.exe The sql.exe application runs on the IPC@CHIP. In this section, the source code of sql.c is explained. In the first section, the variables are defined: After that, the user is queried by the application for an id of the person he wants to read from the database. Enter a valid id, which you have defined in your testdb database table earlier. After that, a SQL query string is constructed with the given data.

If the user has entered the ID 1, the sqlrequest would look like this: 172.30.10.96:80/chip/wrapper.php?user=bob&pass =secret&db=tes tdb&sql=select+*+from+testable+where+number+=+ 1 In the next section, the application calls httpget and waits for an answer of the Apache web server. If there is a valid result it is printed to the console. The following screenshot shows an example. The user entered the ID 1 and received 1 frank smith as answer:

4.4 wrapper.php The wrapper.php first extracts the GET-parameters from the IPC@CHIP request. Then it opens a connection to the database and places the query. The results are then echoed back to the IPC@CHIP 4.5 Variations In this example, a SQL SELECT statement is passed to the wrapper.php. It is also possible to pass other SQL statements (like INSERT, DELETE, UPDATE ) to the PHP script, you might have to alter the PHP file or write other PHP files which react differently to different request types.

4.6 Security Please note that all data passed to the web server and returned is not encrypted and can be read by network sniffers or other tools. If you need secure data exchange, you have to think about encrypting your data.