PHP and Mysql Database. PHP and Database Mysql – popular open-source database management system PHP usually works with Mysql for web-based database applications.

Slides:



Advertisements
Similar presentations
Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
Advertisements

XAMPP: Cross – Apache, MySQL, Php, Perl + FileZilla, Tomcat NetBeans: IDE PHP Installation.
Intermediate PHP & MySQL
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
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,
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.
Internet and Web Application Development Revision.
INTERNET APPLICATION DEVELOPMENT For More visit:
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
PHP MySQL Introduction
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
INTERNET APPLICATION DEVELOPMENT PRACTICAL ON CONNECTING TO MYSQL.
 Mysql – popular open-source database management system  PHP usually works with Mysql for web- based database applications  LAMP applications—Web-based.
Databases in Visual Studio. Database in VisualStudio An MS SQL database are built in Visual studio The Name can be something like ”(localdb)\Projects”
Python MySQL Database Access
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.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
PHP Part 2.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
Technology & Management Club Development Software Overview.
Database Fred Durao What is a database? A database is any organized collection of data. Some examples of databases you may encounter in.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
With SQL Michael Pace & Jerome Martinez. What is CoffeeScript? CoffeeScript is a language that compiles to JavaScript. Therefore, it can be used to interact.
MySQL Database Connection
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP & MySQL.
PHP Database connectivity Connecting with RDBMS and editing, adding, and deleting databases therein are all done through PHP functions.
PHP Database Processing CIS 1715 Web Technologies.
SQL Unit – 2 Base Knowledge Presented By Mr. R.Aravindhan.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Module Review Basic SQL commands: Create Database, Create Table, Insert and Select 2. Connect an SQL Database to PHP 3. Execute SQL Commands in.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
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.
PHP Database Pemrograman Internet. PHP MySQL Database With PHP, you can connect to and manipulate databases. MySQL is the most popular database system.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
CHAPTER 10 PHP MySQL Database
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
به نام خدا SQL QUIZ جوانمرد Website: ejavanmard.blogfa.com.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
SQL Reminder Jiankang Yuan Martin Lemke. SQL Reminder - SELECT SELECT column_name1, column_name2, … FROM table_name SELECT * FROM table_name.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
PHP & MY SQL Instructor: Monireh H. Sayadnavard 1.
Tried my best to simplify it for you!
PHP: MySQL Lecture 14 Kanida Sinmai
Web Systems & Technologies
CS311 Database Management system
Introduction to Web programming
PHP + MySQL Commands Refresher.
Using SQL Server through Command Prompt
PhpMyaAmin & MySQL PHP: Hypertext Preprocessor.
ISC440: Web Programming 2 Server-side Scripting PHP 3
SQL Queries Chapter No 3.
Web Programming Language
MySQL Database System Installation Overview SQL summary
Introduction to Web programming
Conection
មជ្ឈមណ្ឌលកូរ៉េ សហ្វវែរ អេច អ ឌី
SQL NOT NULL Constraint
Presentation transcript:

PHP and Mysql Database

PHP and Database Mysql – popular open-source database management system PHP usually works with Mysql for web-based database applications LAMP applications—Web-based applications that use Lynux, Apache, Mysql, and php/pearl/python

Basic Steps to Process DB 1.Connect to host server which has Mysql installed 2.Select a database 3.Form an SQL statement 4.Execute the SQL statement and (optionally) return a record set 5.Extract data from recordset using php 6.Close connection

CONNECT TO MYSQL

Create a Database SQL – CREATE DATABASE database_name PHP $con = mysql_connect("localhost","peter", "abc123"); $sql = “CREATE DATABASE myDB”; mysql_query(“$sql”, $con));

Create a Table SQL – CREATE TABLE table_name (column_name1 data_type, column_name2 data_type, column_name3 data_type,.... )

Create a Table PHP PHP // Connect to Mysql $con = mysql_connect(...); // Create database mysql_query("CREATE DATABASE my_db",$con); // Select DB mysql_select_db("my_db", $con); // Create table $sql = "CREATE TABLE Persons( FirstName varchar(15), LastName varchar(15), Age int )”; // Execute SQL statement mysql_query($sql, $con); ";

Select a Database When DB already exists: PHP $con = mysql_connect("localhost","peter", "abc123"); $db = mysql_select_db("my_db“, $con);

Executing a SELECT Query SQL SELECT colName1, colName2, colName3 FROM Persons; PHP $con = mysql_connect(...); mysql_select_db("my_db“, $con); $sql = “SELECT FirstName, LastName FROM Persons;”; $result = mysql_query($sql);

Printing Results of SQL Statement PHP $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ echo $row['FirstName']. " ". $row['LastName']; echo " "; }

Inserting Record into Table SQL INSERT INTO table_name VALUES (value1, value2, value3,...) or INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)

Inserting Record into Table

Inserting Record into Table From HTML Form Firstname: Lastname: Age:

Inserting Record into Table From HTML Form

Update Record SQL UPDATE table_name SET column1=value, column2=value2,... WHERE some_column = some_value;

Update Record

Delete Record SQL Delete table_name WHERE some_column = some_value;

Delete Record