This lecture. PHP tags

Size: px
Start display at page:

Download "This lecture. PHP tags"

Transcription

1 This lecture Databases I This covers the (absolute) basics of and how to connect to a database using MDB2. (GF Royle , N Spadaccini 2008) I 1 / 24 (GF Royle , N Spadaccini 2008) I 2 / 24 What is? tags is a scripting language that is widely used for writing Web pages. It allows the user to write pages that combine static HTML together with embedded code. When such a page is requested by a browser, the page is parsed by the webserver. The static HTML is simply passed straight through to the client, while the code is executed and replaced by its output. The website is the primary online reference for. code is incorporated into an HTML document by enclosing it inside special tags.... Here is an example of a fairly minimal snippet of code. <body> print("<h1>db3240z Project</h1>"); </body> (To save space, I am omitting the DOCTYPE line, the <html>...</html> tags and the head-element of the page, but they should be included.) This combined HTML/ document should be saved in a file with a.php extension (such as home.php or test.php etc). (GF Royle , N Spadaccini 2008) I 3 / 24 (GF Royle , N Spadaccini 2008) I 4 / 24

2 The is interpreted Testing scripts When the client requests the document, the.php extension tells the Web server to run the file through the interpreter before delivering it to the client. The single statement print "<h1>db3240z Project</h1>"; is executed and produces the output <h1>db3240z Project</h1> This output is then sent to the client along with the static HTML, so all the client sees is the HTML. <body> <h1>db3240z Project</h1></body> If a script contains a syntax error and cannot be parsed by the interpreter, then usually no output at all is generated and nothing is sent to the client. The error messages generated by the interpreter are recorded in the web server s error log: Mon Sep 18 15:00: ] [error] [client ] Parse error: syntax error, unexpected < in /mnt/data0/cits3240/db3240/public_html/test0.php on line 4 This can make debugging a program a time-consuming and tedious affair edit the webpage, reload in the web browser, then check the error log. (GF Royle , N Spadaccini 2008) I 5 / 24 (GF Royle , N Spadaccini 2008) I 6 / 24 Standalone To speed up this process, you can run as a standalone program just to debug the portions of the code. While logged in to the server machine, which in our case is db3240.csse.uwa.edu.au simply type php test.php and error messages and/or the output of the script will be produced at the terminal. Of course, once the syntax errors are corrected, you must then ensure that the output is valid HTML. A second example Of course, would not be much use if all it could do was produce static text this example shows how a function can be used. <body> <h1>db3240z Project Page</h1> <p> Today s date is print date("d d F Y"); </p> </body> The date() function returns the current date formatted according to the specified format string: Today s date is Mon 18 September 2006 (GF Royle , N Spadaccini 2008) I 7 / 24 (GF Royle , N Spadaccini 2008) I 8 / 24

3 programming Programming As well as an extensive library of built-in functions, is actually a fully-featured (procedural) programming language. A lot of the low-level syntax of is similar to the C programming language, and so is very familiar to C and/or Java programmers. One major different is that in, unlike C and Java, the programmer does not have to declare variables before they are used, and the type system is quite a bit looser. Variables Programming In, variables are represented by a dollar sign ($) followed by the variable name. A variable need not be declared before use, and its type is inferred from the value assigned to it. Thus $a = 10; $name = Australia ; makes $a an integer and $name a string. If you subsequently perform an assignment like $a = $name; then the type of $a is simply reassigned to string. (GF Royle , N Spadaccini 2008) I 9 / 24 (GF Royle , N Spadaccini 2008) I 10 / 24 Types has 8 basic types: Four scalar types boolean integer float string Two compound types array object Two special types resource NULL Programming Scalar Types Programming The scalar types boolean, integer and float which are used for boolean, integer and floating-point values respectively, behave much as you would expect from experience with their Java counterparts. However strings in are quite different to Java s String. A string behaves as an array of byte-sized characters (hence has no native Unicode support) hence they are mutable. $name = Australia ; $name[0] = B ; print $name; would generate the output Bustralia. (GF Royle , N Spadaccini 2008) I 11 / 24 (GF Royle , N Spadaccini 2008) I 12 / 24

4 String Manipulation Programming Which quotes? Programming String manipulation is very important in /MySQL applications because (just as in JDBC) the program must build up the query strings in order to send them to the MySQL server. In Java, the + operator is overloaded to perform string concatenation, but in the corresponding operator is the dot, or period (.). Thus after the code $code = " AUS "; $query = SELECT * FROM Country WHERE Code =. $code; the variable $query would be equal to the string SELECT * FROM Country WHERE Code = AUS Like MySQL, strings in can be created with either single or double quotes. $query = "SELECT * FROM Country WHERE Code = ". $code; The difference between the two types of quote is that if a string is constructed with double quotes, then any variable-name contained within the string is expanded. So a statement like $query = "SELECT * FROM Country WHERE Code = $code"; would substitute the value AUS where the variable $code appears. This makes string construction quite a bit simpler in than in Java. (GF Royle , N Spadaccini 2008) I 13 / 24 (GF Royle , N Spadaccini 2008) I 14 / 24 Connecting to a database MDB2 There are a variety of different ways to connect to a database in. In particular, supports direct connections to a MySQL database through functions such as mysql_connect(), mysql_query() and so on. These functions work perfectly well, but they are MySQL specific and tie your code to this particular database. A more extensible solution is to route the database commands through a database abstraction layer this provides a database-independent interface combined with different database drivers in much the same way as JDBC. The database abstraction layer that we will use is provided by the MDB2 module from PEAR (the Extension and Application Repository). Information on PEAR in general can be found at and on MDB2 in particular at The operation of MDB2 is completely analogous to using JDBC the programmer must obtain a connection, then use that connection to execute queries and process the results. (GF Royle , N Spadaccini 2008) I 15 / 24 (GF Royle , N Spadaccini 2008) I 16 / 24

5 MDB2 setup Obtaining a connection The first thing that is needed is to ensure that the MDB2 module is loaded in your script. This is accomplished by including the MDB2 code into your script using the require_once statement. require_once "/usr/local/lib/php/mdb2.php"; There are other statements include, require and include_once for including external files that have slightly different behaviour. To obtain a connection you use the function MDB2::connect() where the argument is a data source name. $dsn = "mysqli://db3240:xxxxxx@localhost/db3240"; $conn =& MDB2::connect($dsn) This snippet connects the user db3240 to the database db3240 on the local machine with the password XXXXXX the general syntax of the data source name is phptype://username:password@hostspec/database In our case, the mysqli portion says to use the MySQL Improved driver. (GF Royle , N Spadaccini 2008) I 17 / 24 (GF Royle , N Spadaccini 2008) I 18 / 24 Reference Assignment The assignment to the variable $conn used the special =& assignment operator which performs a reference assignment. A reference assignment simply makes the variable into a new reference to the same item (array, string, object etc) it does not make a new copy of the underlying item. Reference assignments are familiar to Java programmers because all non-primitive Java assignments are reference assignments. Check the result! The MDB2::connect() function may fail for a number of different reasons (unreachable server, incorrect password etc) and so it is crucial to check that no error has occurred. If an error does occur then the function returns an error object which contains information about the error. if (MDB2::isError($conn)) { print $conn->getuserinfo(); print "\n"; die("connection Failed\n"); This uses the function MDB2::isError() to check if $conn is an error. If it is, then it terminates with some diagnostic information. (GF Royle , N Spadaccini 2008) I 19 / 24 (GF Royle , N Spadaccini 2008) I 20 / 24

6 Making a query Making a query involves constructing an SQL statement as a string and then calling the query() method of the $conn object. The syntax for calling an object method in is to use -> where you would use a. in Java. $sql = "SELECT name, population FROM Country WHERE population > "; $result =& $conn->query($sql); if (MDB2::isError($result)) { die($result->getuserinfo()); This method returns either a result object or an error so once again we make sure to check that the statement executed successfully. Processing the results If there are no errors, then the variable $result refers to an object very similar to a JDBC ResultSet. This result object behaves somewhat like a cursor, in that it has a method fetchrow() that fetches the current row (as an array) and moves down to the next row. while ($row =& $result->fetchrow()) { // do something with the row The fetchrow() method returns NULL if there are no more rows to be fetched, and so incorporating it into a while loop is a simple way to process each row in turn. (GF Royle , N Spadaccini 2008) I 21 / 24 (GF Royle , N Spadaccini 2008) I 22 / 24 Output Cleanup In this example we will simply print out the data contained in each row, so that the webpage provides information about heavily populated countries. while ($row =& $result->fetchrow()) { print "<p>$row[0] has a population of $row[1]</p>"; Each row is an array containing two elements, which are indexed $row[0] and $row[1] just as in Java, and the print statement prints them out along with suitable HTML tags. Finally the script should release any resources that it currently is holding. $result->free(); $conn->disconnect(); These would happen automatically when the script ends, but if it is a very large script making multiple database connections, then it is better to release them explicitly when they are no longer needed. (GF Royle , N Spadaccini 2008) I 23 / 24 (GF Royle , N Spadaccini 2008) I 24 / 24

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24

Databases PHP I. (GF Royle, N Spadaccini ) PHP I 1 / 24 Databases PHP I (GF Royle, N Spadaccini 2006-2010) PHP I 1 / 24 This lecture This covers the (absolute) basics of PHP and how to connect to a database using MDB2. (GF Royle, N Spadaccini 2006-2010) PHP

More information

PHP: Hypertext Preprocessor. A tutorial Introduction

PHP: Hypertext Preprocessor. A tutorial Introduction PHP: Hypertext Preprocessor A tutorial Introduction Introduction PHP is a server side scripting language Primarily used for generating dynamic web pages and providing rich web services PHP5 is also evolving

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 Web Database Programming Using PHP Techniques for programming dynamic features

More information

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2 Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 1 Web Database Programming Using PHP Techniques for programming dynamic features

More information

Chapter 9 SQL in a server environment

Chapter 9 SQL in a server environment Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP Database connection The third

More information

This lecture. Databases - JDBC I. Application Programs. Database Access End Users

This lecture. Databases - JDBC I. Application Programs. Database Access End Users This lecture Databases - I The lecture starts discussion of how a Java-based application program connects to a database using. (GF Royle 2006-8, N Spadaccini 2008) Databases - I 1 / 24 (GF Royle 2006-8,

More information

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) A Server-side Scripting Programming Language An Introduction What is PHP? PHP stands for PHP: Hypertext Preprocessor. It is a server-side

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

(Refer Slide Time: 01:40)

(Refer Slide Time: 01:40) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #25 Javascript Part I Today will be talking about a language

More information

HTML 5 Form Processing

HTML 5 Form Processing HTML 5 Form Processing In this session we will explore the way that data is passed from an HTML 5 form to a form processor and back again. We are going to start by looking at the functionality of part

More information

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist.

Development Technologies. Agenda: phpmyadmin 2/20/2016. phpmyadmin MySQLi. Before you can put your data into a table, that table should exist. CIT 736: Internet and Web Development Technologies Lecture 10 Dr. Lupiana, DM FCIM, Institute of Finance Management Semester 1, 2016 Agenda: phpmyadmin MySQLi phpmyadmin Before you can put your data into

More information

Real SQL Programming 1

Real SQL Programming 1 Real SQL Programming 1 SQL in Real Programs We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database Reality is almost always

More information

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC. hapter 1 INTRODUTION SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: Java features. Java and its associated components. Features of a Java application and applet. Java data types. Java

More information

Database-Connection Libraries. Java Database Connectivity PHP

Database-Connection Libraries. Java Database Connectivity PHP Database-Connection Libraries Call-Level Interface Java Database Connectivity PHP 1 An Aside: SQL Injection SQL queries are often constructed by programs. These queries may take constants from user input.

More information

Database-Connection Libraries

Database-Connection Libraries Database-Connection Libraries CALL-LEVEL INTERFACE JAVA DATABASE CONNECTIVITY PHP PEAR/DB 1 An Aside: SQL Injection SQL queries are often constructed by programs. These queries may take constants from

More information

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley PHP and MySQL for Dynamic Web Sites Intro Ed Crowley Class Preparation If you haven t already, download the sample scripts from: http://www.larryullman.com/books/phpand-mysql-for-dynamic-web-sitesvisual-quickpro-guide-4thedition/#downloads

More information

PHP. Interactive Web Systems

PHP. Interactive Web Systems PHP Interactive Web Systems PHP PHP is an open-source server side scripting language. PHP stands for PHP: Hypertext Preprocessor One of the most popular server side languages Second most popular on GitHub

More information

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Web programming The PHP language Our objective Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Access data inserted by users into HTML forms Interact

More information

Non-interactive SQL. EECS Introduction to Database Management Systems

Non-interactive SQL. EECS Introduction to Database Management Systems Non-interactive SQL EECS3421 - Introduction to Database Management Systems Using a Database Interactive SQL: Statements typed in from terminal; DBMS outputs to screen. Interactive SQL is inadequate in

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

Databases SQL IV. (GF Royle, N Spadaccini ) SQL IV 1 / 25

Databases SQL IV. (GF Royle, N Spadaccini ) SQL IV 1 / 25 Databases SQL IV (GF Royle, N Spadaccini 2006-2010) SQL IV 1 / 25 This lecture We continue our coverage of the fundamentals of SQL/MySQL with stored routines. (GF Royle, N Spadaccini 2006-2010) SQL IV

More information

SEER AKADEMI LINUX PROGRAMMING AND SCRIPTINGPERL 7

SEER AKADEMI LINUX PROGRAMMING AND SCRIPTINGPERL 7 SEER AKADEMI LINUX PROGRAMMING AND SCRIPTINGPERL 7 Hi everyone once again welcome to this lecture we are actually the course is Linux programming and scripting we have been talking about the Perl, Perl

More information

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems Database Programming in PHP Li Xiong Department of Mathematics and Computer Science Emory University Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP

More information

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population In this lab, your objective is to learn the basics of creating and managing a DB system. One way to interact with the DBMS (MySQL)

More information

PHP: The Basics CISC 282. October 18, Approach Thus Far

PHP: The Basics CISC 282. October 18, Approach Thus Far PHP: The Basics CISC 282 October 18, 2017 Approach Thus Far User requests a webpage (.html) Server finds the file(s) and transmits the information Browser receives the information and displays it HTML,

More information

MySQL: Querying and Using Form Data

MySQL: Querying and Using Form Data MySQL: Querying and Using Form Data CISC 282 November 15, 2017 Preparing Data $mysqli >real_escape_string($datavalue); Requires a $mysqli object Functional version mysqli_real_escape_string( ) does not

More information

Today's Goals. CSCI 2910 Client/Server-Side Programming. Objects in PHP. Defining a Class. Creating a New PHP Object Instance

Today's Goals. CSCI 2910 Client/Server-Side Programming. Objects in PHP. Defining a Class. Creating a New PHP Object Instance CSCI 2910 Client/Server-Side Programming Topic: More Topics in PHP Reading: Williams & Lane pp. 108 121 and 232 243 Today's Goals Today we will begin with a discussion on objects in PHP including how to

More information

CHAPTER 10. Connecting to Databases within PHP

CHAPTER 10. Connecting to Databases within PHP CHAPTER 10 Connecting to Databases within PHP CHAPTER OBJECTIVES Get a connection to a MySQL database from within PHP Use a particular database Send a query to the database Parse the query results Check

More information

Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion

Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion IN5290 Ethical Hacking Lecture 7: Web hacking 3, SQL injection, Xpath injection, Server side template injection, File inclusion Universitetet i Oslo Laszlo Erdödi Lecture Overview What is SQL injection

More information

Learning Objectives. Description. Your AU Expert(s) Trent Earley Behlen Mfg. Co. Shane Wemhoff Behlen Mfg. Co.

Learning Objectives. Description. Your AU Expert(s) Trent Earley Behlen Mfg. Co. Shane Wemhoff Behlen Mfg. Co. PL17257 JavaScript and PLM: Empowering the User Trent Earley Behlen Mfg. Co. Shane Wemhoff Behlen Mfg. Co. Learning Objectives Using items and setting data in a Workspace Setting Data in Related Workspaces

More information

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

Relational terminology. Databases - Sets & Relations. Sets. Membership

Relational terminology. Databases - Sets & Relations. Sets. Membership Relational terminology Databases - & Much of the power of relational databases comes from the fact that they can be described analysed mathematically. In particular, queries can be expressed with absolute

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 112 Introduction to Computing II Wayne Snyder Department Boston University Today: Java basics: Compilation vs Interpretation Program structure Statements Values Variables Types Operators and Expressions

More information

JAVASCRIPT BASICS. JavaScript String Functions. Here is the basic condition you have to follow. If you start a string with

JAVASCRIPT BASICS. JavaScript String Functions. Here is the basic condition you have to follow. If you start a string with JavaScript String Functions Description String constants can be specified by enclosing characters or strings within double quotes, e.g. "WikiTechy is the best site to learn JavaScript". A string constant

More information

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL Real 1 Options We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional

More information

Variables, Constants, and Data Types

Variables, Constants, and Data Types Variables, Constants, and Data Types Strings and Escape Characters Primitive Data Types Variables, Initialization, and Assignment Constants Reading for this lecture: Dawson, Chapter 2 http://introcs.cs.princeton.edu/python/12types

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

CS312: Programming Languages. Lecture 21: JavaScript

CS312: Programming Languages. Lecture 21: JavaScript CS312: Programming Languages Lecture 21: JavaScript Thomas Dillig Thomas Dillig, CS312: Programming Languages Lecture 21: JavaScript 1/25 Why Discuss JavaScript? JavaScript is very widely used and growing

More information

Systems Programming & Scripting

Systems Programming & Scripting Systems Programming & Scripting Lecture 19: Database Support Sys Prog & Scripting - HW Univ 1 Typical Structure of a Web Application Client Internet Web Server Application Server Database Server Third

More information

Introduction of PHP Created By: Umar Farooque Khan

Introduction of PHP Created By: Umar Farooque Khan 1 Introduction of PHP Created By: Umar Farooque Khan 2 What is PHP? PHP stand for hypertext pre-processor. PHP is a general purpose server side scripting language that is basically used for web development.

More information

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase PHP for PL/SQL Developers Lewis Cunningham JP Morgan Chase 1 What is PHP? PHP is a HTML pre-processor PHP allows you to generate HTML dynamically PHP is a scripting language usable on the web, the server

More information

MySQL On Crux Part II The GUI Client

MySQL On Crux Part II The GUI Client DATABASE MANAGEMENT USING SQL (CIS 331) MYSL ON CRUX (Part 2) MySQL On Crux Part II The GUI Client MySQL is the Structured Query Language processor that we will be using for this class. MySQL has been

More information

Why Discuss JavaScript? CS312: Programming Languages. Lecture 21: JavaScript. JavaScript Target. What s a Scripting Language?

Why Discuss JavaScript? CS312: Programming Languages. Lecture 21: JavaScript. JavaScript Target. What s a Scripting Language? Why Discuss JavaScript? CS312: Programming Languages Lecture 21: JavaScript Thomas Dillig JavaScript is very widely used and growing Any AJAX application heavily relies on JavaScript JavaScript also has

More information

Lesson 13 Transcript: User-Defined Functions

Lesson 13 Transcript: User-Defined Functions Lesson 13 Transcript: User-Defined Functions Slide 1: Cover Welcome to Lesson 13 of DB2 ON CAMPUS LECTURE SERIES. Today, we are going to talk about User-defined Functions. My name is Raul Chong, and I'm

More information

Chapter 9 SQL in a server environment

Chapter 9 SQL in a server environment Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP SQL in Real Programs We have

More information

"Charting the Course... Intermediate PHP & MySQL Course Summary

Charting the Course... Intermediate PHP & MySQL Course Summary Course Summary Description In this PHP training course, students will learn to create database-driven websites using PHP and MySQL or the database of their choice. The class also covers SQL basics. Objectives

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

Running SQL in Java and PHP

Running SQL in Java and PHP Running SQL in Java and PHP FCDB 9.6 9.7 Dr. Chris Mayfield Department of Computer Science James Madison University Mar 01, 2017 Introduction to JDBC JDBC = Java Database Connectivity 1. Connect to the

More information

Server side basics CS380

Server side basics CS380 1 Server side basics URLs and web servers 2 http://server/path/file Usually when you type a URL in your browser: Your computer looks up the server's IP address using DNS Your browser connects to that IP

More information

SQL: Data Sub Language

SQL: Data Sub Language SQL: Data Sub Language SQL used with regular Language SQL used to deal with the database Stores/Updates data Retrieves data Regular language deals with other aspects of the program: Makes beautiful web

More information

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed:

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed: PHP Reference 1 Preface This tutorial is designed to teach you all the PHP commands and constructs you need to complete your PHP project assignment. It is assumed that you have never programmed in PHP

More information

Lecture 13: MySQL and PHP. Monday, March 26, 2018

Lecture 13: MySQL and PHP. Monday, March 26, 2018 Lecture 13: MySQL and PHP Monday, March 26, 2018 MySQL The Old Way In older versions of PHP, we typically used functions that started with mysql_ that did not belong to a class For example: o o o o mysql_connect()

More information

NEO OPC Client Driver. The NEO OPC Client can be launched by configuring an OPC Link from the New Link or Add Link dialog as the followings:

NEO OPC Client Driver. The NEO OPC Client can be launched by configuring an OPC Link from the New Link or Add Link dialog as the followings: The configuration program provides a built-in OPC UA Client that enables connections to OPC Servers. The NEO OPC Client is built with the OPC Client SDK and can be used to interactively browse and retrieve

More information

This lecture. Basic Syntax

This lecture. Basic Syntax This lecture Databases - Database Definition This lecture covers the process of implementing an ER diagram as an actual relational database. This involves converting the various entity sets and relationship

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 1 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) WHO

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Project One PHP Preview Project One Grading Methodology Return Project One & Evaluation Sheet Project One Evaluation Methodology Consider each project in and of itself

More information

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Chapter 7:- PHP. Compiled By:- Sanjay Patel Assistant Professor, SVBIT. Chapter 7:- PHP Compiled By:- Assistant Professor, SVBIT. Outline Starting to script on server side, Arrays, Function and forms, Advance PHP Databases:-Basic command with PHP examples, Connection to server,

More information

Full file at

Full file at Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional

More information

Chapter 13 Introduction to SQL Programming Techniques

Chapter 13 Introduction to SQL Programming Techniques Chapter 13 Introduction to SQL Programming Techniques Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Outline Database Programming: Techniques and Issues Embedded

More information

All India Council For Research & Training

All India Council For Research & Training WEB DEVELOPMENT & DESIGNING Are you looking for a master program in web that covers everything related to web? Then yes! You have landed up on the right page. Web Master Course is an advanced web designing,

More information

SQL Injection Attack Lab

SQL Injection Attack Lab SEED Labs SQL Injection Attack Lab 1 SQL Injection Attack Lab Copyright 2006-2016 Wenliang Du, Syracuse University. The development of this document was partially funded by the National Science Foundation

More information

Using PHP with MYSQL

Using PHP with MYSQL Using PHP with MYSQL PHP & MYSQL So far you've learned the theory behind relational databases and worked directly with MySQL through the mysql command-line tool. Now it's time to get your PHP scripts talking

More information

Running SQL in Java and PHP

Running SQL in Java and PHP Running SQL in Java and PHP FCDB 9.6 9.7 Dr. Chris Mayfield Department of Computer Science James Madison University Feb 28, 2018 Introduction to JDBC JDBC = Java Database Connectivity 1. Connect to the

More information

WKA Studio for Beginners

WKA Studio for Beginners WKA Studio for Beginners The first and foremost, the WKA Studio app and its development are fundamentally different from conventional apps work and their developments using higher level programming languages

More information

O ne of the most important features of JavaServer

O ne of the most important features of JavaServer INTRODUCTION TO DATABASES O ne of the most important features of JavaServer Pages technology is the ability to connect to a Databases store and efficiently manage large collections of information. JSP

More information

Lecture 9&10 JDBC. Mechanism. Some Warnings. Notes. Style. Introductory Databases SSC Introduction to DataBases 1.

Lecture 9&10 JDBC. Mechanism. Some Warnings. Notes. Style. Introductory Databases SSC Introduction to DataBases 1. Lecture 9&10 JDBC Java and SQL Basics Data Manipulation How to do it patterns etc. Transactions Summary JDBC provides A mechanism for to database systems An API for: Managing this Sending s to the DB Receiving

More information

Stored procedures - what is it?

Stored procedures - what is it? For a long time to suffer with this issue. Literature on the Internet a lot. I had to ask around at different forums, deeper digging in the manual and explain to himself some weird moments. So, short of

More information

Transaction Isolation Level in ODI

Transaction Isolation Level in ODI In this post I will be explaining the behaviour in Oracle 11g and regarding the ODI versions, there is not much difference between ODI 11g and 12c. If you see the drop down in 11g (11.1.1.9) procedure,

More information

Values and Variables 1 / 30

Values and Variables 1 / 30 Values and Variables 1 / 30 Values 2 / 30 Computing Computing is any purposeful activity that marries the representation of some dynamic domain with the representation of some dynamic machine that provides

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies Database Systems: Design, Implementation, and Management Tenth Edition Chapter 14 Database Connectivity and Web Technologies Database Connectivity Mechanisms by which application programs connect and communicate

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 10 Outline Database Programming: Techniques and Issues Embedded SQL, Dynamic SQL, and SQLJ Database Programming with Function Calls: SQL/CLI and JDBC Database Stored Procedures and SQL/PSM Comparing

More information

Final-Term Papers Solved MCQS with Reference

Final-Term Papers Solved MCQS with Reference Solved MCQ(S) From FinalTerm Papers BY Arslan Jan 14, 2018 V-U For Updated Files Visit Our Site : Www.VirtualUstaad.blogspot.com Updated. Final-Term Papers Solved MCQS with Reference 1. The syntax of PHP

More information

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet 1. Macros 1.1 What is a macro? A macro is a set of one or more actions

More information

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional

More information

Embedded SQL. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

Embedded SQL. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 Embedded SQL csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 Problems with using interactive SQL Standard SQL is not Turing-complete. E.g., Two profs

More information

API Gateway Version September Key Property Store User Guide

API Gateway Version September Key Property Store User Guide API Gateway Version 7.5.2 15 September 2017 Key Property Store User Guide Copyright 2017 Axway All rights reserved. This documentation describes the following Axway software: Axway API Gateway 7.5.2 No

More information

Chapter 2: Using Data

Chapter 2: Using Data Chapter 2: Using Data TRUE/FALSE 1. A variable can hold more than one value at a time. F PTS: 1 REF: 52 2. The legal integer values are -2 31 through 2 31-1. These are the highest and lowest values that

More information

PHP & My SQL Duration-4-6 Months

PHP & My SQL Duration-4-6 Months PHP & My SQL Duration-4-6 Months Overview of the PHP & My SQL Introduction of different Web Technology Working with the web Client / Server Programs Server Communication Sessions Cookies Typed Languages

More information

Embedded SQL. csc343, Introduction to Databases Diane Horton with examples from Ullman and Widom Fall 2014

Embedded SQL. csc343, Introduction to Databases Diane Horton with examples from Ullman and Widom Fall 2014 Embedded SQL csc343, Introduction to Databases Diane Horton with examples from Ullman and Widom Fall 2014 Problems with using interactive SQL Standard SQL is not Turing-complete. E.g., Two profs are colleagues

More information

Instructor: Craig Duckett. Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL

Instructor: Craig Duckett. Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL Instructor: Craig Duckett Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL 1 Assignment 3 is due LECTURE 20, Tuesday, June 5 th Database Presentation is due LECTURE 20, Tuesday,

More information

Programmazione Avanzata

Programmazione Avanzata Programmazione Avanzata Programmazione Avanzata Corso di Laurea in Informatica (L31) Scuola di Scienze e Tecnologie Programmazione Avanzata 1 / 51 Programming paradigms Programmazione Avanzata Corso di

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity

Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity Objectives Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity Setting Up JDBC Before you can begin to utilize JDBC, you must

More information

My name is Brian Pottle. I will be your guide for the next 45 minutes of interactive lectures and review on this lesson.

My name is Brian Pottle. I will be your guide for the next 45 minutes of interactive lectures and review on this lesson. Hello, and welcome to this online, self-paced lesson entitled ORE Embedded R Scripts: SQL Interface. This session is part of an eight-lesson tutorial series on Oracle R Enterprise. My name is Brian Pottle.

More information

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s Intro to Python Python Getting increasingly more common Designed to have intuitive and lightweight syntax In this class, we will be using Python 3.x Python 2.x is still very popular, and the differences

More information

COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts

COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Web Scripting using PHP

Web Scripting using PHP Web Scripting using PHP Server side scripting No Scripting example - how it works... User on a machine somewhere Server machine So what is a Server Side Scripting Language? Programming language code embedded

More information

C# and Java. C# and Java are both modern object-oriented languages

C# and Java. C# and Java are both modern object-oriented languages C# and Java C# and Java are both modern object-oriented languages C# came after Java and so it is more advanced in some ways C# has more functional characteristics (e.g., anonymous functions, closure,

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

A brief introduction to C programming for Java programmers

A brief introduction to C programming for Java programmers A brief introduction to C programming for Java programmers Sven Gestegård Robertz September 2017 There are many similarities between Java and C. The syntax in Java is basically

More information

La Mesa Language Reference Manual COMS 4115: Programming Languages and Translators Professor Stephen Edwards

La Mesa Language Reference Manual COMS 4115: Programming Languages and Translators Professor Stephen Edwards La Mesa Language Reference Manual COMS 4115: Programming Languages and Translators Professor Stephen Edwards Michael Vitrano Matt Jesuele Charles Williamson Jared Pochtar 1. Introduction La Mesa is a language

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Chapters 10 & 11 PHP AND MYSQL

Chapters 10 & 11 PHP AND MYSQL Chapters 10 & 11 PHP AND MYSQL Getting Started The database for a Web app would be created before accessing it from the web. Complete the design and create the tables independently. Use phpmyadmin, for

More information

CSCI/CMPE Object-Oriented Programming in Java JDBC. Dongchul Kim. Department of Computer Science University of Texas Rio Grande Valley

CSCI/CMPE Object-Oriented Programming in Java JDBC. Dongchul Kim. Department of Computer Science University of Texas Rio Grande Valley CSCI/CMPE 3326 Object-Oriented Programming in Java JDBC Dongchul Kim Department of Computer Science University of Texas Rio Grande Valley Introduction to Database Management Systems Storing data in traditional

More information

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective- UNIT -II Style Sheets: CSS-Introduction to Cascading Style Sheets-Features- Core Syntax-Style Sheets and HTML Style Rle Cascading and Inheritance-Text Properties-Box Model Normal Flow Box Layout- Beyond

More information

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP?

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP? PHP 5 Introduction What You Should Already Know you should have a basic understanding of the following: HTML CSS What is PHP? PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open

More information