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.

Slides:



Advertisements
Similar presentations
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.
Advertisements

PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
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.
Web Database Programming Connecting Database to Web.
PHP and MySQL PHP for the Web, page PHP and MySQL MySQL Resource PHP – MySQL Resource
Multiple Tiers in Action
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
PHP : Working with Resultsets. Last class  Open a connection to the MySQL server.  Specify the database  Issue queries (no updates at this stage) 
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.
PHP1-1 PHP & SQL Xingquan (Hill) Zhu
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,
Class 3 MySQL Robert Mudge Reference:
Application Sketch home.htm delete.php updateform.php display.php insert.php insertform.htm update.php Data Base Hyperlink Information exchange with database.
CS411 Database Systems Kazuhiro Minami 07: SQL System Aspects.
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.
Server-side Scripting Powering the webs favourite services.
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
INTERNET APPLICATION DEVELOPMENT PRACTICAL ON CONNECTING TO 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.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Accessing MySQL with PHP IDIA 618 Fall 2014 Bridget M. Blodgett.
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.
MySQL and PHP 3 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
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.
PHP Part 2.
INTERNET APPLICATION DEVELOPMENT Practical on Sessions.
1. Connecting database from PHP 2. Sending query 3. Fetching data 4. Persistent connections 5. Best practices.
Lecture 10 – MYSQL and PHP (Part 2)
Technology & Management Club Development Software Overview.
Database Access with PHP and MySQL CS356 Examples from Web Database Applications, by Hugh E. Williams & David Lane, O'Reilly, 2002.
Looking for simple php script Language: PHP Must be php>>>>> I can not use an other language Budget: $30.0 If more than $30.0 Please do not bid Login page.
MySQL Database Connection
PHP - MySQL Connection 8 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
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.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP & MySQL.
Retrieving data from MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
2010/11 : [1]PHP with MySQLBuilding Web Applications using MySQL and PHP (W1) PHP with MySQL.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
PHP and Mysql Database. PHP and Database Mysql – popular open-source database management system PHP usually works with Mysql for web-based database applications.
THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week.
Controlling Web Site Access Using Logins CS 320. Basic Approach HTML form a php page that collects the username and password  Sends them to second PHP.
Module Review Basic SQL commands: Create Database, Create Table, Insert and Select 2. Connect an SQL Database to PHP 3. Execute SQL Commands in.
PHP getting data from a MySQL database. Replacing XML as data source with MySQL Previously we obtained the data about the training session from an XML.
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.
Accessing mySQL relational database. MySQL database.  Today, we will attempt and open a connection to the MySQL server.  We need to specify the database.
Database MySQL Universitas Muhammadiyah Surakarta Yogiek Indra Kurniawan.
>> PHP: MySQL & CRUD. R ecall Database Tables Records is composed of Operations (CRUD) Create Retrieve Update Delete DBMS Access Control MySQL phpMyAdmin.
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,
MySQL MySQL and PHP – interacting with a database.
PHP with MYSQL Please use speaker notes for additional information!
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 8 – Review Reference:
Introduction to Dynamic Web Programming
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
IS1500: Introduction to Web Development
MySQL tutorial.
Accessing Your MySQL Database from the Web with PHP (Ch 11)
Server-Side Processing II
PHP: Combo box FdSc Module 109 Server side scripting and
Database Access with PHP and MySQL
Presentation transcript:

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 about 5,000,000,000 rows

MySQL & PHP Connecting To A DB Usually Store in Connect.INC mysql_connect("localhost","cs3ai01","saUrZnPP") OR die("Could Not Connect to Database"); mysql_select_db("cs3ai01") or die("Failed Selecting to DB"); DB HOST Username Password Database Name

MySQL & PHP Querying A DB After Connecting $query = "SELECT Name, Colour, Fabric, Engine_Size, Cost, FROM Products WHERE Type = 'Motorcycle'"; $result = mysql_query($query); SQL Query Tag Select Variables DB Name Where Clause Saves Data Received in result

MySQL & PHP Insert into Database $query = "INSERT INTO StudentMarks (StudentID,Mark,SubjectCode,Component) VALUES (“ ”,”80”,”CSE32MS”,”Assignment”)"; $result = mysql_query($query); SQL Query TagInsert DB Tag DB Value ID’s DB Value TagInsert Values Db Name

MySQL & PHP Deleting From The DB $query = "DELETE FROM StudentMarks WHERE StudentID = '$student_number' AND SubjectCode = '$subject' AND Component = '$component'"; $result = mysql_query($query); SQL Query TagDelete DB Tag Db Name

MySQL & PHP Updating Values In DB $query = "UPDATE StudentMarks SET Mark = $Mark WHERE Component = '$component' AND StudentID = $student_number AND SubjectCode = '$subject'"; $result = mysql_query($query); SQL Query TagUpdate DB Tag Db Name DB Set Where Clause New Value

MySQL & PHP Displaying Retrieved Data Product Name Colour Fabric Engine Size Cost Site <?php while( $row = mysql_fetch_array($result) ) { ?> <?php echo $row["Name"]; ?>

MySQL & PHP Combination Of HTML, PHP & Mysql > HTML Tag PHP Tag Retrieved DB Info

PHP, MySQL & An Image DB <?php include("../connect.inc"); $query = "SELECT Colour,Image_Name FROM Images WHERE Type = 'Car' AND Colour = 'Black'"; $result = mysql_query($query); ?> <?php if( mysql_num_rows($result) < 1) { include("error.htm"); die(); } ?> <?php while( $row = mysql_fetch_array($result) ) { ?> <img border="0" src= > <?php } ?>

Class Example <?php if( $component == "" ) { include("empty-component-error.php"); die(); } else { include("connect.inc"); $query = "SELECT Component FROM StudentMarks WHERE Component = ‘$component’ AND SubjectCode = “CSE32MS” AND StudentID = “ ”"; $result = mysql_query($query); if( mysql_num_rows($result) < 1 ) { $component_found = FALSE; include("no-component-error.php"); } ?>

Class Example <?php $username = “John”; $FirstName = “John”; $Surname = “Little”; $Access = “Administrator”; $password = “Monday”; $query = "INSERT INTO Users (LoginName,FirstName,Surname,Password,Access) VALUES ('$username','$password','$firstname','$password', '$access')"; $res= mysql_query($query); echo mysql_error(); include("complete-contents.htm");} ?>

References: On the ICC Web Page there are a PHP and MySQL manuals in the form of a help files and so that you can easily refer to them.