Project Description. Creating your dababase application with PHP It will be sufficient to have an application that accommodates all the need of the intended.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

PHP II Interacting with Database Data. The whole idea of a database-driven website is to enable the content of the site to reside in a database, and to.
AN INTRODUCTION TO PL/SQL Mehdi Azarmi 1. Introduction PL/SQL is Oracle's procedural language extension to SQL, the non-procedural relational database.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
Keys, Referential Integrity and PHP One to Many on the Web.
Exploring Microsoft Access 2003 Chapter 1 Introduction to Microsoft Access: What Is A Database?
Faculty of Sciences and Social Sciences HOPE PHP & MySQL Stewart Blakeway FML 213
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Inclass Test Revision Database Technology Level I Lecture and Seminar Revision.
Project Description. Creating your dababase application with JDBC Develop a JAVA application based on the examples (in /oracle/app/oracle/ /sqlj/demo)
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
1 CSC 440 Database Management Systems JDBC This presentation uses slides and lecture notes available from
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
Making ODBC easier By Dave Doulton University of Southampton.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using PhP.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
PHP meets MySQL.
Exploring Microsoft Access 97 Chapter 1 Introduction to Microsoft Access: What Is A Database? Office graphic copyright by Microsoft Corp.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Introduction to MySQL Lab no. 10 Advance Database Management System.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
Database Fred Durao What is a database? A database is any organized collection of data. Some examples of databases you may encounter in.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2015, Fred McClurg, All Rights.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Advanced SQL: Cursors & Stored Procedures
Oracle 11g DATABASE DEVELOPMENT LAB1. Introduction  Oracle 11g Database:-  Oracle 11g database is designed for some features, which helps to the organizations.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
2010/11 : [1]PHP with MySQLBuilding Web Applications using MySQL and PHP (W1) PHP with MySQL.
13. PHP: Insert, View Data. M. Udin Harun Al Rasyid, S.Kom, Ph.D Desain dan Pemrograman.
Programmatic SQL Shaista Khan CS 157B. Topic Embedded SQL statements in high-level programming languages.
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
Using SQL in PL/SQL ITEC 224 Database Programming.
>> PHP: Insert Query & Form Processing. Insert Query Step 1: Define Form Variables Step 2: Make DB Connection Step 3: Error Handling Step 4: Define the.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
CMPT 258 Database Systems The Relationship Model (Chapter 3)
PHP Programming. Topics Database Handling (MySQL, MSSQL, ODBC)
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Function, Trigger used in PosgreSQL.
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
ACCESS CHAPTER 2 Introduction to ACCESS Learning Objectives: Understand ACCESS icons. Use ACCESS objects, including tables, queries, forms, and reports.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Web Database Programming Using PHP
Web Database Programming Using PHP
Session 4 PHP & MySQL.
CPSC-310 Database Systems
ISC440: Web Programming 2 Server-side Scripting PHP 3
PDO Database Connections: Getting data out of the database
Chapter 8 Working with Databases and MySQL
Web DB Programming: PHP
Tutorial 6 PHP & MySQL Li Xu
CS3220 Web and Internet Programming SQL and MySQL
Grauer and Barber Series Microsoft Access Chapter One
CS3220 Web and Internet Programming SQL and MySQL
Introduction to Web programming
Presentation transcript:

Project Description

Creating your dababase application with PHP It will be sufficient to have an application that accommodates all the need of the intended users, allows the updating the database information, and provides an interface for query answering. It is hoped that you come up with a system that is user friendly (menu driven, GUI etc.).

Example The system: student information system Intended user groups: students, professors, cashiers, secretaries Students: –want to view their record –the system should have a feature allowing a student to enter his id and obtains his transcript!

Example The system: student information system Intended user groups: students, professors, cashiers, secretaries Professors: –want to get the class listing –the system should have a feature allowing a professor to enter his id and class id and obtains the class roster! But he should only get the classes that he is teaching

What is “allows the updating the database information”? Your database will be stored in Oracle – you will need to provide users a way to update information. Example: Student Information System We need to allow the registrar office to add new students, new courses, update students’ grades etc.

What is “provides an interface for query answering”? Summary questions are often posted to a database application. Your application will not be an exception. You have thought about the ten most often asked questions in your application. You need to provide users who has a question in the ten frequently asked questions to ask your system one of the ten questions and get the answer from the system.

NOTE There is not always a clear distinction between “accommodates all the need of the intended users” and “provides an interface for query answering”. One might be used for another.

Your application YOUR APPLICATION IN PHP & HTML & ANYTHING THAT YOU LIKE TO PUT IN Oracle DB

PHP – Oracle Examples See the link from class note website /PHPhttp:// /PHP Too many websites on PHP to list here

PHP – An Introduction Web programming Simple yet good enough Basic types: –Scalar types: boolean, integer, float, string –Compound types: array, object –Special types: resource, NULL Variables begins with $ - no need for declaration (bad:-) Control: –if –while –for See copy of chapter on PHP for more

PHP with Oracle Create a connection to Oracle (session) $conn = ocilogon( $name, $pwd, "cs482" ); Prepare a statement $cmdstr = "select * from pi"; $parsed = ociparse($conn, $cmdstr); Execute a statement ociexecute($parsed); Processing the result

PHP – Oracle Display Result (Example 1) Fetch the result $nrows = ocifetchstatement($parsed,$results); $result –is like a two dimensions array –$result[$name][$n] – the value of the attribute $name, $n th row Example for ($i = 0; $i < $nrows; $i++ ) { echo $results["IID"][$i] ; echo $results["OID"][$i] ; echo $results["ICOST"][$i] ; echo "\n"; } Column Name Row number $result $c1 $c2 $c3 $c

PHP – Oracle Dynamic column name (Example 2) $ncols = OCINumCols($parsed); for ($i = 0; $i < $nrows; $i++ ) { for ($j = 1; $j<= $ncols; $j++) { $col_name = OCIColumnName($parsed, $j); echo $results[$col_name][$i]. " "; } Get the number of columns Concatenation operator

Dynamic Command String (Example 3) $tablename $oid $sid $eid $cmdstr = "insert into ". $tablename. " values(". $oid. ",". $eid. ", ". $sid. ")"; $parsed = ociparse($conn, $cmdstr); ociexecute($parsed1); Table name Order id Supplier id Employee id Create the command string Parse & execute

PHP – Function (Example 5) <?php // do something display($v11,$v12,$v13) // do something else display($v21,$v22,$v23) function display($arg1,$arg2,$arg3) { function’s body } ?>

What is enough? A program that allows one to do all the required tasks: –Updating data (your application has tables t1, t2, t3, t4 – then the system will have to allow users to enter, modify, or delete data in all four tables) –Asking queries (display answer on screen)

Screen dump example (1) application-team-XX 1.Updating 2.Querying 3.Exit Select 1 – A new screen with 1,2,…,n tables appear for selection

Screen dump example (2) application-team-XX 1.Student table 2.Professor table 3.Course table 4.Exit Select 2 – display the professor table, ask whether the user want to enter new professor, edit some information, or delete

Screen dump example (3) application-team-XX 1.Enter new 2.Modify old 3.Delete Select: ….. And so it goes ….

Nicer – but not required! GUI interface Menu driven