Application Sketch - PowerPoint PPT Presentation

About This Presentation
Title:

Application Sketch

Description:

p a href='display.php' View Records /a /p p a href='insertform.htm' Enter Records /a /p ... form name='form1' method='post' action='update.php' p Name ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 10
Provided by: gerry9
Learn more at: https://www.uky.edu
Category:

less

Transcript and Presenter's Notes

Title: Application Sketch


1
Application Sketch
home.htm
display.php
insertform.htm
updateform.php
update.php
delete.php
insert.php
Data Base
Hyperlink Information exchange with
database Redirection Submit data via
post Hyperlink with URL appended data
2
home.html
  • Untitled Document
  • content"text/html charsetiso-8859-1"
  • Main Home Page
  • View Records
  • Enter Records

3
insertform.htm
  • Untitled Document
  • content"text/html charsetiso-8859-1"
  • home
  • action"insert.php"
  • Name
  • Age
  • value"Submit"

4
insert.php
  • // script to display all the records in a table
  • // connection information
  • hostName "dbm1.itc.virginia.edu"
  • userName user"
  • password password"
  • dbName dbname"
  • // make connection to database
  • mysql_connect(hostName, userName, password) or
    die( "Unable to connect to host hostName")
  • mysql_select_db(dbName) or die("Unable to select
    database dbName")
  • // Insert Data into table1
  • query "INSERT INTO table1 (name, age) VALUES
    ('name', 'age')"
  • result mysql_query(query)
  • // Close the database connection

5
display.php (part 1)
  • Data Display
  • home
  • // script to display all the records in a table
  • // connection information
  • hostName "dbm1.itc.virginia.edu"
  • userName user"
  • password password"
  • dbName dbname"
  • // make connection to database
  • mysql_connect(hostName, userName, password) or
    die( "Unable to connect to host hostName")

6
display.php (part 2)
  • // Determine the number of employees
  • number mysql_numrows(result)
  • // Print the employee names
  • echo("There are number employees")
  • i 0
  • While (i
  • ID mysql_result(result,i, "ID")
  • name mysql_result(result,i, "name")
  • age mysql_result(result,i, "age")
  • echo("ageage\"Update name age href\"delete.php?IDID\"Delete
    ")
  • i i 1
  • // Close the database connection
  • mysql_close()
  • ?

7
updateform.php
  • Untitled Document
  • content"text/html charsetiso-8859-1"
  • home
  • action"update.php"
  • Name
  • echo("name")?"
  • echo("ID")?"
  • Age
  • echo("age")?"
  • value"Submit"

8
update.php
  • // script to display all the records in a table
  • // connection information
  • hostName "dbm1.itc.virginia.edu"
  • userName user"
  • password password"
  • dbName dbname"
  • // make connection to database
  • mysql_connect(hostName, userName, password) or
    die( "Unable to connect to host hostName")
  • mysql_select_db(dbName) or die("Unable to select
    database dbName")
  • // Select all the fields in all the records of
    table1
  • query "UPDATE table1 SET name 'name', age
    'age' WHERE ID 'ID'"
  • result mysql_query(query)

9
delete.php
  • // script to display all the records in a table
  • // connection information
  • hostName "dbm1.itc.virginia.edu"
  • userName user"
  • password password"
  • dbName dbname"
  • // make connection to database
  • mysql_connect(hostName, userName, password) or
    die( "Unable to connect to host hostName")
  • mysql_select_db(dbName) or die("Unable to select
    database dbName")
  • // Select all the fields in all the records of
    table1
  • query "DELETE FROM table1 WHERE ID 'ID'"
  • result mysql_query(query)
Write a Comment
User Comments (0)
About PowerShow.com