Advanced PHP: Using PHP with MySQL C. Daniel Chase The University of Tennessee at Chattanooga.

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

WordPress from Start to Finish Day 1: Installing and Using WordPress Looking at the WordPress database.
User Authentication with DB Cs346 Fall Requirements Web site is for registered users only – Username and password – Password is encripted.
雲端計算 Cloud Computing Lab - EyeOS. Agenda Installation Programming.
Lecture 4: Introduction to PHP 3 PHP & MySQL
Encrypted Passwords. your_password + username $u = crypt ( your_password ) PHP insert username + $u SQL MySQL database username | encrypted password username.
ADVM420- Class #4 Web Design with PHP and MySQL Adding and Listing from a MySQL Database.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Class 3 MySQL Robert Mudge Reference:
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.
INTERNET APPLICATION DEVELOPMENT For More visit:
ASP.NET Programming with C# and SQL Server First Edition
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Web Application Development. Define ER model in QSEE Generate SQL Create Database mySQL Write Script to use TableEditor class Process to create A simple.
Web Application Development. Tools to create a simple web- editable database QSEE MySQL (or PHPMyAdmin) PHP TableEditor.
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Database overview. Information in a db The transformation of raw data into organized tables of information … indexed by unique keys … supporting rapid.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
MySQL. MySQL is a Relational Database Management System (RDBMS) that runs as a server providing multiuser access to a number of databases. A third party.
MySQL and PHP 3 March 2006 Adina Crainiceanu IT420: Database Management and Organization.
MySQL PHP Web Technology. Logging in to Command Line Start -> Programs -> AppServ -> MySQL Command Line Client Enter Password, then you’ll be working.
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.
PHP+MySQL Integration. Connecting to databases One of the most common tasks when working with dynamic webpages is connecting to a database which holds.
MySQL Database Connection
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Database Concepts CPTE 212 3/19/2015 John Beckett.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Security Considerations Steve Perry
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
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.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Lection №4 Development of the Relational Databases.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
1 Session 6: Database Best Practice iNET Academy Open Source Web Development.
Database MySQL Universitas Muhammadiyah Surakarta Yogiek Indra Kurniawan.
WAMP Server Installatin Shiyun Wen. WAMP Server Installation  WAMP Server is an integrated installation of Apache, MySQL, and PHP for Windows. Following.
PhpMyAdmin Matthew Walsh April 28, 2003 CMSC Shawn Sivy.
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
Steps to Install VirtueMart 1. Setup Database 2. Download VirtueMart 3. Setup VirtueMart 4. Test installation Prerequisites: 1. XAMPP installation complete.
How Web Database Architectures Work CPS181s April 8, 2003.
Visual Database Creation with MySQL Workbench 도시정보시스템 설계
Lab 3.21 MySQL Database Lab Developing the Tools May 5 th, 2004 Montréal, Québec Dominik Gehl Hôpital Ste-Justine, Montréal.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Mantis Bug Tracker. MantisBT features Open source web-based bug tracking system. Track software defects. Mantis is often configured by users to serve.
MySQL and PHPMyAdmin 1. Make sure your MySQL service is running. If using XAMPP, open the control panel. If the button for MySQL says Start, click it.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
DEV Training Sahana Developer Training. DEV Training PHP.
sTGC production database design
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Install WordPress with Xampp
Unix System Administration
MySQL and PHPMyAdmin.
Easy Way to Reset WordPress Admin Password on Localhost? Guided By: WPGLOBALSUPPORTWPGLOBALSUPPORT.
PHP and MySQL.
Chapter 8 Working with Databases and MySQL
PHPMyAdmin.
MySQL and PHPMyAdmin 1.
PHP and MySQL.
Create New User in Database. First Connect the System.
Presentation transcript:

Advanced PHP: Using PHP with MySQL C. Daniel Chase The University of Tennessee at Chattanooga

Overview ● Introduction to PHPMyAdmin to Manage MySQL ● MySQL Management ● Introduction to Database Design ● Creation of Databases ● Using PHP with MySQL ● Useful PHP Functions

PHPMyAdmin ● Web-based interface for managing MySQL ● Download from phpmyadmin.net ● Can install in user web space—ours is in system-wide location: ● Setup by editing config.inc.php – For auth_type config ● Set controluser & controlpass – Read-only access to mysql/user – Read-only access to mysql/db ● Set user & pass

PHPMyAdmin Configuration ● Setup by editing config.inc.php – For auth_type config ● Set controluser & controlpass – Read-only access to mysql/user – Read-only access to mysql/db ● Set user & pass – For auth_type http ● Set auth_type to http ● Set controluser & controlpass as above ● Set user & pass to “” ● Do Not Set Apache to require authentication! ● Trick: With NEW MySQL Install, Use PHPMyAdmin to create & set passwords in MySQL BEFORE doing above

Managing MySQL with PHPMyAdmin ● Adding Users ● Setting passwords ● Note: These are Exclusive to MySQL! ● Granting Rights – Database level access control – Table level control – Field level control – Operation control – Remote location limits

Database Design ● Database Normalization ● First Normal form – Each column contains atomic values – Each column has unique name – Table has unique Primary Key – No two rows identical – No repeating groups of data ● Second Normal Form – Applies only to multi-column primary keys – Move data only dependent on part of primary key

Database Design ● Third Normal Form – Remove transitive dependencies—column not directly reliant on primary key, but on another that is ● Relationships – One-to-Many – One-to-One – Many-to-Many

Creation of Databases ● New Database require MySQL root privileges ● If using http authentication, admin can create database & users authorized to access, then allow access for user to create actual tables, etc. ● Grant appropriate Rights to User ● Suggest admin creating – Database level admin user with full rights – Database level read-only user with SELECT only rights

Using PHP with MySQL ● Create connection to MySQL – $conn = mysql_connect(“localhost”, “username”, “password”) or die (“Could not connct to database”); – $conn = mysql_pconnect(“localhost”, “username”, “password”) or die (“Could not connct to database”); ● Select database – $db = mysq_select(“database”) or die(“Could not select database”); ● Send Query – $result = mysql_query(“SELECT * FROM table”) or die(mysql_error());