IT3101
Web-based Database
Development
Tusabe Lawrence
ltusabe@gmail.com
Purpose Of Course
 To impart theoretical and practical skills for
developing web-based database systems using
PHP, MYSQL and SQL
2
Course Content
 Overview of Client-side scripting technologies
 Overview of Server-side scripting languages
 An introduction to the Database tier with specific emphasis on
MySQL
 Learning PHP
 PHP Basics:- Introduction, Installation, Syntax
 Variables, Arrays and Strings
 Operators
 Conditions and Branches:- If...Else, Switch
 Loops:- While Loops, For Loops
 Functions
 Forms: - Data Entry with $_GET $_POST functions and
Validation
 MySQL databases
3
Course Content (cont...)
 Database Basics
 Loading a Database
 MySQL command Interpreter
 Creating a database
 Modifying a database
 Inserts, Updates, and Deletes
 Querying a database
 MySQL functions in PHP
 Populating Web pages from a database
 User-Driven Querying
 Previous and Next Browsing
 User Authentication and Management
 Reporting
4
Introduction
 Welcome. If you are thumbing through these
pages, you’re probably considering writing Web-
based applications with PHP and MySQL.
 If you decide to go with these tools, you’ll be in
excellent company.
 Thousands of developers from total newbies to
programmers with years of experience are turning
to PHP and MySQL for their Web-based projects,
and for good reason.
5
Introduction
 PHP and MySQL are easy to use, fast, free, and
powerful. If you want to get a dynamic Web site up
quickly, there are no better choices.
 PHP scripting language built for the Web. All the tasks
common to Web development can be performed in
PHP with an absolute minimum of effort.
 MySQL excels at tasks common to dynamic Web
sites. Whether you’re creating a content-management
system or an e-commerce application, MySQL is a
great choice for your data storage.
6
How This Course Is Organized
Part I: Working with MySQL
 Before you code any PHP scripts you need to
know how to design a database, create tables
in your database, and get the information you
want from the database.
 Part I shows you just about everything you
need to know to work with MySQL.
7
How This Course Is Organized
Part II: Working with PHP
 As an applications developer, you will spend
the bulk of your time writing scripts that access
the database and present HTML to a user’s
browser.
 Part II starts by the basics of the PHP scripting
language, covering how PHP works with
variables, conditions, and control structures.
 Part II also covers many of PHP’s functions
and discusses techniques for writing clean,
manageable code.
8
How This Course Is Organized
Part III: Simple Applications
 In this part we present two applications: a
guestbook and a survey. Here you see the
lessons from Parts I and II put into practice as
we build working applications.
9
Apache
 The Apache Web server is the most popular Web
server. Like Linux, PHP, and MySQL, is an open-
source project.
 Apache works best in Unix environments, but also
runs just fine under Windows.
 PHP most often runs as an Apache extension,
known as an Apache module. Apache is a great
Web server. It is extremely quick and amazingly
stable.
10
Relational Databases
 Relational database management systems (RDBMS)
provide a great way to store and access complex
information.
 They predate the Web, Linux, and Windows, so there
are many RDBMS to choose from. All the major
databases make use of the Structured Query
Language (SQL).
 Some of the more popular commercial RDBMS are
Oracle, Sybase, Informix, Microsoft’s SQL Server, and
IBM’s DB2. In addition to MySQL, there are now two
major open-source relational databases. Postgres and
Borland
11
Why PHP?
 It’s fast and easy: From everything we know, we feel
safe in saying that PHP is as fast as anything out
there.
 It’s cross-platform: PHP runs on Windows, 2000, NT,
CE, XP and Unix and with both IIS and Apache. PHP
works as well on as wide a variety of systems as any
other available product.
 It accesses everything: What do you need to access
in the course of creating your Web applications?
LDAP? IMAP mail server? Oracle? Informix? DB2?
Whatever you need to use, it is more than likely that
PHP has a built-in set of functions that make getting
whatever you need very easy.
12
Why PHP?
 It’s constantly being improved
 Your peers can support you: If you run into trouble if
there’s a bug in your code that you just can’t figure out
or if you can’t seem to fathom some function or
another someone among the hundreds subscribed to
PHP mailing lists will be happy to check and fix your
code.
 It’s free: If you have a computer, Linux, Apache, and
PHP are all completely free.
13
Why PHP?
 PHP runs on various platforms (Windows,
Linux, Unix, Mac OS X, etc.)
 PHP is compatible with almost all servers used
today (Apache, IIS, etc.)
 PHP supports a wide range of databases
 PHP is free. Download it from the official PHP
resource: www.php.net
 PHP is easy to learn and runs efficiently on the
server side
14
Why MySQL?
 It’s cost-effective: Think of Oracle installation? Get
ready to shell out tens of thousands of dollars at a
minimum. There’s no doubt that Oracle, Sybase, and
Informix create terrific databases, but the cost
involved is prohibitive for many. MySQL is free for
development and can be used in a live production
environment for a minimal cost
 It’s quick and powerful: MySQL might not have
every bell and whistle available for a relational
database, but for most users it has plenty. If you are
serving out Web content or creating a moderately
sized commerce site, MySQL has all the power you
need.
15
Why MySQL?
 It’s improving all the time: MySQL is improving at a
staggering rate. The developers release updates
frequently and are adding impressive features all the
time.
16

Lecture1 introduction by okello erick

  • 1.
  • 2.
    Purpose Of Course To impart theoretical and practical skills for developing web-based database systems using PHP, MYSQL and SQL 2
  • 3.
    Course Content  Overviewof Client-side scripting technologies  Overview of Server-side scripting languages  An introduction to the Database tier with specific emphasis on MySQL  Learning PHP  PHP Basics:- Introduction, Installation, Syntax  Variables, Arrays and Strings  Operators  Conditions and Branches:- If...Else, Switch  Loops:- While Loops, For Loops  Functions  Forms: - Data Entry with $_GET $_POST functions and Validation  MySQL databases 3
  • 4.
    Course Content (cont...) Database Basics  Loading a Database  MySQL command Interpreter  Creating a database  Modifying a database  Inserts, Updates, and Deletes  Querying a database  MySQL functions in PHP  Populating Web pages from a database  User-Driven Querying  Previous and Next Browsing  User Authentication and Management  Reporting 4
  • 5.
    Introduction  Welcome. Ifyou are thumbing through these pages, you’re probably considering writing Web- based applications with PHP and MySQL.  If you decide to go with these tools, you’ll be in excellent company.  Thousands of developers from total newbies to programmers with years of experience are turning to PHP and MySQL for their Web-based projects, and for good reason. 5
  • 6.
    Introduction  PHP andMySQL are easy to use, fast, free, and powerful. If you want to get a dynamic Web site up quickly, there are no better choices.  PHP scripting language built for the Web. All the tasks common to Web development can be performed in PHP with an absolute minimum of effort.  MySQL excels at tasks common to dynamic Web sites. Whether you’re creating a content-management system or an e-commerce application, MySQL is a great choice for your data storage. 6
  • 7.
    How This CourseIs Organized Part I: Working with MySQL  Before you code any PHP scripts you need to know how to design a database, create tables in your database, and get the information you want from the database.  Part I shows you just about everything you need to know to work with MySQL. 7
  • 8.
    How This CourseIs Organized Part II: Working with PHP  As an applications developer, you will spend the bulk of your time writing scripts that access the database and present HTML to a user’s browser.  Part II starts by the basics of the PHP scripting language, covering how PHP works with variables, conditions, and control structures.  Part II also covers many of PHP’s functions and discusses techniques for writing clean, manageable code. 8
  • 9.
    How This CourseIs Organized Part III: Simple Applications  In this part we present two applications: a guestbook and a survey. Here you see the lessons from Parts I and II put into practice as we build working applications. 9
  • 10.
    Apache  The ApacheWeb server is the most popular Web server. Like Linux, PHP, and MySQL, is an open- source project.  Apache works best in Unix environments, but also runs just fine under Windows.  PHP most often runs as an Apache extension, known as an Apache module. Apache is a great Web server. It is extremely quick and amazingly stable. 10
  • 11.
    Relational Databases  Relationaldatabase management systems (RDBMS) provide a great way to store and access complex information.  They predate the Web, Linux, and Windows, so there are many RDBMS to choose from. All the major databases make use of the Structured Query Language (SQL).  Some of the more popular commercial RDBMS are Oracle, Sybase, Informix, Microsoft’s SQL Server, and IBM’s DB2. In addition to MySQL, there are now two major open-source relational databases. Postgres and Borland 11
  • 12.
    Why PHP?  It’sfast and easy: From everything we know, we feel safe in saying that PHP is as fast as anything out there.  It’s cross-platform: PHP runs on Windows, 2000, NT, CE, XP and Unix and with both IIS and Apache. PHP works as well on as wide a variety of systems as any other available product.  It accesses everything: What do you need to access in the course of creating your Web applications? LDAP? IMAP mail server? Oracle? Informix? DB2? Whatever you need to use, it is more than likely that PHP has a built-in set of functions that make getting whatever you need very easy. 12
  • 13.
    Why PHP?  It’sconstantly being improved  Your peers can support you: If you run into trouble if there’s a bug in your code that you just can’t figure out or if you can’t seem to fathom some function or another someone among the hundreds subscribed to PHP mailing lists will be happy to check and fix your code.  It’s free: If you have a computer, Linux, Apache, and PHP are all completely free. 13
  • 14.
    Why PHP?  PHPruns on various platforms (Windows, Linux, Unix, Mac OS X, etc.)  PHP is compatible with almost all servers used today (Apache, IIS, etc.)  PHP supports a wide range of databases  PHP is free. Download it from the official PHP resource: www.php.net  PHP is easy to learn and runs efficiently on the server side 14
  • 15.
    Why MySQL?  It’scost-effective: Think of Oracle installation? Get ready to shell out tens of thousands of dollars at a minimum. There’s no doubt that Oracle, Sybase, and Informix create terrific databases, but the cost involved is prohibitive for many. MySQL is free for development and can be used in a live production environment for a minimal cost  It’s quick and powerful: MySQL might not have every bell and whistle available for a relational database, but for most users it has plenty. If you are serving out Web content or creating a moderately sized commerce site, MySQL has all the power you need. 15
  • 16.
    Why MySQL?  It’simproving all the time: MySQL is improving at a staggering rate. The developers release updates frequently and are adding impressive features all the time. 16