Application Sketch home.htm delete.php updateform.php display.php insert.php insertform.htm update.php Data Base Hyperlink Information exchange with database.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Widhy Hayuhardhika NP, S.Kom. Overview of database structure Connecting to MySQL database Selecting the database to use Using the require_once statement.
Working with Tables 1 of 5. Working with Tables 2 of 5.
CHAPTER 10 COMMON PROGRAMMING TECHNIQUES. SENDING VALUES TO A SCRIPT Hidden form input type: Depending on the method, $_POST['do'] or $_GET['do'] will.
PHP and MySQL Database. Connecting to MySQL Note: you need to make sure that you have MySQL software properly installed on your computer before you attempt.
Murach’s Java SE 6, C21© 2007, Mike Murach & Associates, Inc.Slide 1.
Web Database Programming Connecting Database to Web.
NMD202 Web Scripting Week5. What we will cover today PHPmyAdmin Debugging – using print_r Modifying Data PHP (cont.) 4D Methodology File and IO operations.
Manipulating MySQL Databases with PHP. PHP and mySQL2 Objectives Connect to MySQL from PHP Learn how to handle MySQL errors Execute SQL statements with.
Objectives Connect to MySQL from PHP
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
ADVM420- Class #4 Web Design with PHP and MySQL Adding and Listing from a MySQL Database.
David Evans CS200: Computer Science University of Virginia Computer Science Class 29: Vocational Skills How to Build a.
PHP : Working with Resultsets. Last class  Open a connection to the MySQL server.  Specify the database  Issue queries (no updates at this stage) 
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables. A table is a collections of related data entries and.
Deleting and Updating Records in MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
1 Chapter 8 – Working with Databases spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
INTERNET APPLICATION DEVELOPMENT For More visit:
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
PHP – MySQL Extensions. Table used in most examples CREATE TABLE product ( rowID INT NOT NULL AUTO_INCREMENT, productid VARCHAR(8) NOT NULL, name VARCHAR(25)
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
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.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
PHP MySQL. SQL: Tables CREATE TABLE tablename { fieldname type(length) extra info,... } Extra info: –NULL (allows nulls in this field) –Not NULL (null.
Assignment help PHP + MySQL crash course Minpeng Zhu.
Lec_6 Manipulating MySQL Databases with PHP PHP Programming with MySQL.
MySQL PHP Web Technology. Logging in to Command Line Start -> Programs -> AppServ -> MySQL Command Line Client Enter Password, then you’ll be working.
MySQL Databases & PHP Integration Using PHP to write data to, and retrieve data from, a MySQL database.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
Lecture 10 – MYSQL and PHP (Part 2)
Technology & Management Club Development Software Overview.
MICROSOFT ACCESS With your host: Daniel McAllister.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
CHAPTER 9 PHP AND MYSQL. A POSSIBLE SITE CONFIGURATION Application Folder index.php includes (folder)header.phpfooter.phpstyle.cssmodel (folder)mysqli_connect.php.
Intro to DatabasesClass 4 SQL REVIEW To talk to the database, you have to use SQL SQL is used by many databases, not just MySQL. SQL stands for Structured.
Creating PHPs to Insert, Update, and Delete Data CS 320.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
What have we learned?. What is a database? An organized collection of related data.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
MySQL. Is a SQL (Structured Query Language) database server. Can be accessed using PHP with embedded SQL Queries Supports Large DB’s, 60,000 tables with.
Accessing mySQL relational database. MySQL database.  Today, we will attempt and open a connection to the MySQL server.  We need to specify the database.
NMED 3850 A Advanced Online Design January 14, 2010 V. Mahadevan.
PHP: MySQL. PHP Connect to MySQL PHP 5 and later can work with a MySQL database using: – MySQLi extension (the "i" stands for improved) – PDO (PHP Data.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
Producing a Mail Merged Letter Step 1 Create an Access database for Names and Addresses you can use the ‘Customers’ template in Group Work. Enter the necessary.
Access Lessons 4 and 5 © 2009 M and K Solutions, LLC -- All Rights Reserved.
System Modules Overview
PHP MySQL1 PHP and MySQL After this lecture, you should be able to:  Access a MySQL database with PHP  mysql_connect()  mysql_select_db()  mysql_query()
David Evans CS200: Computer Science University of Virginia Computer Science Class 32: Vocational Skills (How to Build.
1 ERP Support Portal ERP Department 25 th November 2015 User Guide.
PHP: MySQL Lecture 14 Kanida Sinmai
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
MySQL tutorial.
PHP and MySQL.
Class 29: Vocational Skills How to Build a Dynamic Web Site
Create New User in Database. First Connect the System.
HTML Forms & PHP & MySQL Database
Web Programming– UFCFB Lecture
Updating Databases With Open SQL
Introduction to Web programming
Updating Databases With Open SQL
Presentation transcript:

Application Sketch home.htm delete.php updateform.php display.php insert.php insertform.htm update.php Data Base Hyperlink Information exchange with database Redirection Submit data via post Hyperlink with URL appended data

home.html Untitled Document Main Home Page View Records Enter Records

insertform.htm Untitled Document home Name Age

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 mysql_close(); header("Location: home.htm"); ?>

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"); mysql_select_db($dbName) or die("Unable to select database $dbName"); // Select all the fields in all the records of table1 $query = "SELECT * FROM table1 ORDER BY ID"; $result = mysql_query($query);

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<$number) { $ID = mysql_result($result,$i, "ID"); $name = mysql_result($result,$i, "name"); $age = mysql_result($result,$i, "age"); echo(" Update $name $age Delete "); $i = $i + 1; } // Close the database connection mysql_close(); ?>

updateform.php Untitled Document home Name "> Age ">

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); // Close the database connection mysql_close(); header("Location: display.php"); ?>

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); // Close the database connection mysql_close(); header("Location: display.php"); ?>