SlideShare a Scribd company logo
1 of 20
Download to read offline
Web Basics Programming With PHP
Files
Example
INPUT :
Price and product changes
OUTPUT :
Catalogue
Catalogue
File
Record Format :
(Product_no, Description, Price)
$file=fopen("welcome.txt","r");
fclose($file)
feof($file)
fgets($file) fgetc($file)
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
What is Database?
A database is an organized collection of data. The data are typically organized to model
relevant aspects of reality in a way that supports processes requiring this information
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
Database Vs Files
Files problems
• Have to write procedures to manage the accessibility of
common files.
• Errors occurs through using the files.
• Editing common files structure require editing all the
programs that deal with this file.
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• What is MySQL?
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
MySQL is very fast, reliable, and easy to use
MySQL
Intro
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• What is MySQL?
MySQL supports standard SQL
MySQL compiles on a number of platforms
MySQL is free to download and use
MySQL is developed, distributed, and supported by
Oracle Corporation
MySQL
Intro
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• Connect to DB:
mysql_connect('localhost',‘db_user',‘db_pass')
• Verifying and Select DB:
mysql_select_db(‘db_name')
MySQL
Configuration
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• Why ?
To insert the content of one PHP file into another
PHP file before the server executes it.
• Syntax:
Include & Require
include 'filename';
or
require 'filename';
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• What is Query ?
A query is a question or a request.
We can query a database for specific information and
have a record set returned.
• Ex:
SELECT LastName FROM Employees
MySQL
Query
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
• How can I write Query in php ?
$result = mysql_query("SELECT * FROM Persons");
• How can I get the results ?
mysql_fetch_array($result);
mysql_fetch_assoc($result);
MySQL
Query with php
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
MySQL
Create new DB
// Create database
$sql="CREATE DATABASE my_db";
if (mysql_query($sql)) {
echo "Database my_db created successfully";
} else {
echo "Error creating database: " . mysqli_error($con);
}
OR
MySQL
Create new Table
// Create table
$sql="CREATE TABLE Persons(FirstName CHAR(30),LastName
CHAR(30),Age INT)";
if (mysql_query($sql)) {
echo "Table persons created successfully";
} else {
echo "Error creating table: " . mysqli_error($con);
}
OR
MySQL
Create new Table
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
MySQL
Insert Date to a Table
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
MySQL
Insert Date to a Table
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Peter', 'Griffin',35)");
mysql_query("INSERT INTO Persons (FirstName, LastName, Age)
VALUES ('Glenn', 'Quagmire',33)");
OR
MySQL
Select Data from Table
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
$result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result)) {
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br>";
}
MySQL
Where clause
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
$result = mysql_query("SELECT * FROM Persons
WHERE FirstName='Peter'");
while($row = mysql_fetch_array($result)) {
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br>";
}
MySQL
Update Data In a Database
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
mysql_query("UPDATE Persons SET Age=36
WHERE FirstName='Peter' AND LastName='Griffin'");
MySQL
Delete Data In a Database
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
mysql_query(“DELETE FROM Persons
WHERE FirstName='Peter' AND LastName='Griffin'");
THANK YOU!
Your Logo

More Related Content

What's hot

What's hot (20)

Uploading a file with php
Uploading a file with phpUploading a file with php
Uploading a file with php
 
PHP for hacks
PHP for hacksPHP for hacks
PHP for hacks
 
Introduction to php web programming - get and post
Introduction to php  web programming - get and postIntroduction to php  web programming - get and post
Introduction to php web programming - get and post
 
Php File Upload
Php File UploadPhp File Upload
Php File Upload
 
File Upload
File UploadFile Upload
File Upload
 
Php, mysq lpart1
Php, mysq lpart1Php, mysq lpart1
Php, mysq lpart1
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Working with WP_Query in WordPress
Working with WP_Query in WordPressWorking with WP_Query in WordPress
Working with WP_Query in WordPress
 
php $_GET / $_POST / $_SESSION
php  $_GET / $_POST / $_SESSIONphp  $_GET / $_POST / $_SESSION
php $_GET / $_POST / $_SESSION
 
New Features in PHP 5.3
New Features in PHP 5.3New Features in PHP 5.3
New Features in PHP 5.3
 
Loops PHP 04
Loops PHP 04Loops PHP 04
Loops PHP 04
 
File Uploading in PHP
File Uploading in PHPFile Uploading in PHP
File Uploading in PHP
 
File upload php
File upload phpFile upload php
File upload php
 
Sa
SaSa
Sa
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh PollockExtending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 

Viewers also liked

Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009cwarren
 
Mobile/wireless computing
Mobile/wireless computingMobile/wireless computing
Mobile/wireless computingBryan Alexander
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For BeginnersPriti Solanki
 
Why Learn PHP Programming?
Why Learn PHP Programming?Why Learn PHP Programming?
Why Learn PHP Programming?XtreemHeights
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQLkalaisai
 
wireless sensor network my seminar ppt
wireless sensor network my seminar pptwireless sensor network my seminar ppt
wireless sensor network my seminar pptEisha Madhwal
 

Viewers also liked (9)

Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009
 
Mobile/wireless computing
Mobile/wireless computingMobile/wireless computing
Mobile/wireless computing
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For Beginners
 
Manika
ManikaManika
Manika
 
Why Learn PHP Programming?
Why Learn PHP Programming?Why Learn PHP Programming?
Why Learn PHP Programming?
 
Mobile and wireless computing
Mobile and wireless computingMobile and wireless computing
Mobile and wireless computing
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
wireless sensor network my seminar ppt
wireless sensor network my seminar pptwireless sensor network my seminar ppt
wireless sensor network my seminar ppt
 

Similar to Php workshop L04 database (20)

Mongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg SolutionsMongo Presentation by Metatagg Solutions
Mongo Presentation by Metatagg Solutions
 
Intro to php
Intro to phpIntro to php
Intro to php
 
Php summary
Php summaryPhp summary
Php summary
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2
 
Php Training Workshop by Vtips
Php Training Workshop by VtipsPhp Training Workshop by Vtips
Php Training Workshop by Vtips
 
MySQL with PHP
MySQL with PHPMySQL with PHP
MySQL with PHP
 
MySQL Fulltext Search Tutorial
MySQL Fulltext Search TutorialMySQL Fulltext Search Tutorial
MySQL Fulltext Search Tutorial
 
MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Mysql & Php
Mysql & PhpMysql & Php
Mysql & Php
 
Php with mysql ppt
Php with mysql pptPhp with mysql ppt
Php with mysql ppt
 
PHP and MySQL.pptx
PHP and MySQL.pptxPHP and MySQL.pptx
PHP and MySQL.pptx
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
 
phptut4
phptut4phptut4
phptut4
 
phptut4
phptut4phptut4
phptut4
 
Phphacku iitd
Phphacku iitdPhphacku iitd
Phphacku iitd
 
Php basics
Php basicsPhp basics
Php basics
 
Quick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPQuick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHP
 
Amp and higher computing science
Amp and higher computing scienceAmp and higher computing science
Amp and higher computing science
 
working with PHP & DB's
working with PHP & DB'sworking with PHP & DB's
working with PHP & DB's
 

More from Mohammad Tahsin Alshalabi

NUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node SystemNUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node SystemMohammad Tahsin Alshalabi
 
Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...Mohammad Tahsin Alshalabi
 
Learning management system in information technology engineering faculty
Learning management system in  information technology engineering facultyLearning management system in  information technology engineering faculty
Learning management system in information technology engineering facultyMohammad Tahsin Alshalabi
 
CodeIgniter L5 email & user agent & security
CodeIgniter L5 email & user agent & securityCodeIgniter L5 email & user agent & security
CodeIgniter L5 email & user agent & securityMohammad Tahsin Alshalabi
 
CodeIgniter L4 file upload & image manipulation & language
CodeIgniter L4 file upload & image manipulation & languageCodeIgniter L4 file upload & image manipulation & language
CodeIgniter L4 file upload & image manipulation & languageMohammad Tahsin Alshalabi
 
CodeIgniter L3 model & active record & template
CodeIgniter L3 model & active record  & templateCodeIgniter L3 model & active record  & template
CodeIgniter L3 model & active record & templateMohammad Tahsin Alshalabi
 
CodeIgniter L2 helper & libraries & form validation
CodeIgniter L2 helper & libraries & form validation CodeIgniter L2 helper & libraries & form validation
CodeIgniter L2 helper & libraries & form validation Mohammad Tahsin Alshalabi
 
CodeIgniter L1 introduction to CodeIgniter framework
CodeIgniter L1 introduction to CodeIgniter frameworkCodeIgniter L1 introduction to CodeIgniter framework
CodeIgniter L1 introduction to CodeIgniter frameworkMohammad Tahsin Alshalabi
 
Comparison between web and mobile application requirements
Comparison between web and mobile application requirementsComparison between web and mobile application requirements
Comparison between web and mobile application requirementsMohammad Tahsin Alshalabi
 

More from Mohammad Tahsin Alshalabi (16)

NUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node SystemNUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node System
 
Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...
 
Learning management system in information technology engineering faculty
Learning management system in  information technology engineering facultyLearning management system in  information technology engineering faculty
Learning management system in information technology engineering faculty
 
Moodle documentation
Moodle documentationMoodle documentation
Moodle documentation
 
Moodle plugins programing manual
Moodle plugins programing manualMoodle plugins programing manual
Moodle plugins programing manual
 
CodeIgniter L5 email & user agent & security
CodeIgniter L5 email & user agent & securityCodeIgniter L5 email & user agent & security
CodeIgniter L5 email & user agent & security
 
CodeIgniter L4 file upload & image manipulation & language
CodeIgniter L4 file upload & image manipulation & languageCodeIgniter L4 file upload & image manipulation & language
CodeIgniter L4 file upload & image manipulation & language
 
CodeIgniter L3 model & active record & template
CodeIgniter L3 model & active record  & templateCodeIgniter L3 model & active record  & template
CodeIgniter L3 model & active record & template
 
CodeIgniter L2 helper & libraries & form validation
CodeIgniter L2 helper & libraries & form validation CodeIgniter L2 helper & libraries & form validation
CodeIgniter L2 helper & libraries & form validation
 
CodeIgniter L1 introduction to CodeIgniter framework
CodeIgniter L1 introduction to CodeIgniter frameworkCodeIgniter L1 introduction to CodeIgniter framework
CodeIgniter L1 introduction to CodeIgniter framework
 
Comparison between web and mobile application requirements
Comparison between web and mobile application requirementsComparison between web and mobile application requirements
Comparison between web and mobile application requirements
 
Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web services
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Php workshop L02 php basics
Php workshop L02 php basicsPhp workshop L02 php basics
Php workshop L02 php basics
 
Php workshop L01 CSS
Php workshop L01 CSSPhp workshop L01 CSS
Php workshop L01 CSS
 
Php workshop L0 Introduction
Php workshop L0 IntroductionPhp workshop L0 Introduction
Php workshop L0 Introduction
 

Recently uploaded

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Php workshop L04 database

  • 2. Files Example INPUT : Price and product changes OUTPUT : Catalogue Catalogue File Record Format : (Product_no, Description, Price) $file=fopen("welcome.txt","r"); fclose($file) feof($file) fgets($file) fgetc($file) By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 3. What is Database? A database is an organized collection of data. The data are typically organized to model relevant aspects of reality in a way that supports processes requiring this information By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 4. Database Vs Files Files problems • Have to write procedures to manage the accessibility of common files. • Errors occurs through using the files. • Editing common files structure require editing all the programs that deal with this file. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 5. • What is MySQL? 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 MySQL is very fast, reliable, and easy to use MySQL Intro By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 6. • What is MySQL? MySQL supports standard SQL MySQL compiles on a number of platforms MySQL is free to download and use MySQL is developed, distributed, and supported by Oracle Corporation MySQL Intro By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 7. • Connect to DB: mysql_connect('localhost',‘db_user',‘db_pass') • Verifying and Select DB: mysql_select_db(‘db_name') MySQL Configuration By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 8. • Why ? To insert the content of one PHP file into another PHP file before the server executes it. • Syntax: Include & Require include 'filename'; or require 'filename'; By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 9. • What is Query ? A query is a question or a request. We can query a database for specific information and have a record set returned. • Ex: SELECT LastName FROM Employees MySQL Query By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 10. • How can I write Query in php ? $result = mysql_query("SELECT * FROM Persons"); • How can I get the results ? mysql_fetch_array($result); mysql_fetch_assoc($result); MySQL Query with php By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 11. MySQL Create new DB // Create database $sql="CREATE DATABASE my_db"; if (mysql_query($sql)) { echo "Database my_db created successfully"; } else { echo "Error creating database: " . mysqli_error($con); } OR
  • 12. MySQL Create new Table // Create table $sql="CREATE TABLE Persons(FirstName CHAR(30),LastName CHAR(30),Age INT)"; if (mysql_query($sql)) { echo "Table persons created successfully"; } else { echo "Error creating table: " . mysqli_error($con); } OR
  • 13. MySQL Create new Table By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 14. MySQL Insert Date to a Table By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 15. MySQL Insert Date to a Table By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh mysql_query("INSERT INTO Persons (FirstName, LastName, Age) VALUES ('Peter', 'Griffin',35)"); mysql_query("INSERT INTO Persons (FirstName, LastName, Age) VALUES ('Glenn', 'Quagmire',33)"); OR
  • 16. MySQL Select Data from Table By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh $result = mysql_query("SELECT * FROM Persons"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br>"; }
  • 17. MySQL Where clause By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh $result = mysql_query("SELECT * FROM Persons WHERE FirstName='Peter'"); while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br>"; }
  • 18. MySQL Update Data In a Database By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh mysql_query("UPDATE Persons SET Age=36 WHERE FirstName='Peter' AND LastName='Griffin'");
  • 19. MySQL Delete Data In a Database By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh mysql_query(“DELETE FROM Persons WHERE FirstName='Peter' AND LastName='Griffin'");