SlideShare a Scribd company logo
Introduction
Ayub hussein abdulle
Msc in CSE
University of somalia (UNISO)
PHP & MySQL
 IntroductionIntroduction
 Text Book/Reference MaterialsText Book/Reference Materials
 ContentsContents
 AssessmentAssessment
 QuizQuiz 10%10%
 Ass/PRAss/PR 20%20%
 Mid Quarter ExamMid Quarter Exam 30%30%
 Final ExamFinal Exam 40%40%
 Rules of the classRules of the class
 Mobiles on “Silent” please MSCMobiles on “Silent” please MSC – CSE, Lecturer: Engr. Ayub– CSE, Lecturer: Engr. Ayub
HusseinHussein
 ““No class within class” pleaseNo class within class” please
Introduction to PHP
●
Today’s web user’s expect exciting pages that are
updated frequently and provide a customized
experience for them.
●
Web sites are more like communities to which
they will return time and again.
Cont.
At the same time, website administrators want sites that are
easier to update , maintain and understanding , that is the only
real way to keep up with visitor’s expectations.
For these reasons and more, PHP and MYSQL have become
the fact standards for creating dynamic, database-driven
websites.
PHP History
●
1994: Created by Rasmis Lesdorf, software engineer (part
of Apache Team)
●
1995: Called Personal Home Page Tool, then released as
version 2 with name PHP/FI (Form Interpreter, to analyze
SQL queries)
●
Half 1997: used by 50,000 web sites
●
October 1998: used by 100,000 websites
●
End 1999: used by 1,000,000 websites
Alternatives to PHP
●
Practical extraction and Report Language (Perl)
●
Active Server Pages (ASP)
●
Java server pages (JSP)
●
Ruby
(Good) Topics about PHP
●
Open-source
●
Easy to use ( C-like and Perl-like syntax)
●
Stable and fast
●
Multiplatform
●
Many databases support
●
Many common built-in libraries
●
Pre-installed in Linux distributions
MySQL
●
MySQL is the world’s most popular open-
source database.
●
MySQL is a database management system
(DBMS) for relational databases, therefor
MySQL is an RDBMS.
Cont.’
●
A database , in the simplest terms is a
collection of interrelated data, be it text,
numbers or binary files that are stored and
kept organized by the DBMS.
●
MySQL is an open-source application like
PHP, meaning that it is free to use or even
modify.
Cont.’
●
MySQL software consist of several pieces,
including the MySQL server (mysqld which runs
& manges the databases ), the MySQL
client( mysql, which gives you an interface to the
serves ) and numerous utilities for
maintenance and other purposes.
●
MySQL can handle databases as large as
60,000 tables with more than five billions
rows.
What you’ll need
1. Web server applications ( e.g. apacha, Abyes or IIS)
2. PHP
3. MySQL
4. A web browser ( e.g. Microsoft’s Internet Explorer and
Mozilla’s Firefox )
5. A text editor, PHP-capable such as Adob’s
Dreamweaver qualifies or IDE
6. An FTP application, if using a remote server.
How PHP generates
HTML/JS Web pages
1: Client from browser send HTTP request (with POST/GET
variables)
2: Apache recognizes that a PHP script is requested and sends the
request to PHP module
3: PHP interpreter executes PHP script, collects script output and
sends it back
4: Apache replies to client using the PHP script output as HTML
output
2
Client
Browser
1 PHP
module3
4
Apache
Hello World! (web oriented)
<html>
<head>
<title>My personal Hello World! PHP script</title>
</head>
<body>
<?
echo “Hello World!”;
?>
</html>
PHP tag, allow to insert PHP
code. Interpretation by PHP
module will substitute the code
with code output
Sending data to the web bowser
●
To create dynamic websites with PHP, you must know
how to send data to the web browser.
●
PHP has a number of built-in functions for this purpose,
the most common being echo( ) and print ()
●
e.g: echo ‘ Hello world ‘ ;
●
All PHP statement must end with semicolon.
●
PHP is case-insensitive when it comes to function names,
so Echo ( ), echo ( ), eCHo ( ) will all work.
Writing Comments
●
PHP supports three comments types.
●
The first uses the Pound or number symbol ( # ).
●
e.g. # this is a comment
●
The second uses two slashes.
●
e.g. // this is also comment
●
Both of these cause PHP to ignore everything that
follows untill the end of line, thus these two
comments are for single lines only.
Cont.
A third style allows comments to run over multiple lines.
e.g. /* this is a larger comments that spans too lines of comments. */
●
Variables are containers used to temporarily store
values, these values can be numbers , text or
much more complex data.
●
PHP has eight types of variables.
●
These include four scalar (single –valued) types
Bolean ( true or false), integer, floating point
(decimals ) and strings (characters ); two
nonscalar ( multi-valued) array and object, plus
resource (DB) and null (no value).
What are variables?
Rules of variable
●
Regardless of what type you are creating, all
variables in PHP follow certain syntactical rules.
1. A variable’s name also called its identifier must
start with a dollar sign ($) . E.g. $name
2. The variable’s name can contain a combination of
strings, numbers and the underscore. E.g. $My-
report1.
3. The first character after dollar sign must be a letter
or an underscore ( not be in a number).
Cont.
●
4. Variable names in PHP are case –sensitive.
●
This is very important rule. It means that $name
and $Name are entirely different variables.
●
Note: before getting into a script, there are two
more things you should know, first , variables can
be assigned values using the equal sing ( = ) also
called the assignment operator.
●
Second , variables can be printed with out
quotation mark. E.g.: print $some_var;
Cont.
●
# variables must be printed within double
quotation mark.
●
e.g. : print “ Hello, $name “;
●
# You can not print variables within single
quotation marks.
●
e.g. : print ‘ Hello, $name ‘ ; // won’t work.
END

More Related Content

PPTX
Introduction to webprogramming using PHP and MySQL
anand raj
 
PPTX
PHP web design
Vhin Militante
 
PPT
slidesharenew1
truptitasol
 
PDF
PHP Basics
Roohul Amin
 
PDF
Php tutorial(w3schools)
Arjun Shanka
 
PDF
Php tutorialw3schools
rasool noorpour
 
PPTX
Php reports sumit
Sumit Biswas
 
Introduction to webprogramming using PHP and MySQL
anand raj
 
PHP web design
Vhin Militante
 
slidesharenew1
truptitasol
 
PHP Basics
Roohul Amin
 
Php tutorial(w3schools)
Arjun Shanka
 
Php tutorialw3schools
rasool noorpour
 
Php reports sumit
Sumit Biswas
 

Similar to Php1 (20)

PPT
Introduction to php
Meetendra Singh
 
PPT
PHP MySQL Workshop - facehook
Shashank Skills Academy
 
PPTX
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
PDF
waptLab 04.pdfwaptLab09 tis lab is used for college lab exam
imgautam076
 
PPT
INTRODUCTION TO PHP.ppt
WASIYANILOFARDPSNACH
 
PDF
Introduction to php
KIRAN KUMAR SILIVERI
 
PDF
Php introduction
krishnapriya Tadepalli
 
PPTX
Introduction to-php
AhmedAElHalimAhmed
 
PPTX
Server – side Technologies PHP for web dev.pptx
MarioCaday2
 
PPTX
chapter Two Server-side Script lang.pptx
alehegn9
 
PDF
phptutorial
tutorialsruby
 
PDF
PHP Basics Ebook
Swanand Pol
 
PDF
phptutorial
tutorialsruby
 
PPT
Php intro
Jennie Gajjar
 
PPT
Php intro
Jennie Gajjar
 
PPT
Php intro
Jennie Gajjar
 
PPTX
Php unit i
BagavathiLakshmi
 
PDF
Php Interview Questions
UmeshSingh159
 
PPTX
Php and MySQL final year bca notes for bca.pptx
AJAYKUMAR34368
 
Introduction to php
Meetendra Singh
 
PHP MySQL Workshop - facehook
Shashank Skills Academy
 
Web Application Development using PHP Chapter 1
Mohd Harris Ahmad Jaal
 
waptLab 04.pdfwaptLab09 tis lab is used for college lab exam
imgautam076
 
INTRODUCTION TO PHP.ppt
WASIYANILOFARDPSNACH
 
Introduction to php
KIRAN KUMAR SILIVERI
 
Php introduction
krishnapriya Tadepalli
 
Introduction to-php
AhmedAElHalimAhmed
 
Server – side Technologies PHP for web dev.pptx
MarioCaday2
 
chapter Two Server-side Script lang.pptx
alehegn9
 
phptutorial
tutorialsruby
 
PHP Basics Ebook
Swanand Pol
 
phptutorial
tutorialsruby
 
Php intro
Jennie Gajjar
 
Php intro
Jennie Gajjar
 
Php intro
Jennie Gajjar
 
Php unit i
BagavathiLakshmi
 
Php Interview Questions
UmeshSingh159
 
Php and MySQL final year bca notes for bca.pptx
AJAYKUMAR34368
 
Ad

Recently uploaded (20)

PPTX
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
MCEAMONVILLAVER
 
PPTX
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
PDF
Generative AI Foundations: AI Skills for the Future of Work
hemal sharma
 
PPTX
ppt lighfrsefsefesfesfsefsefsefsefserrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrt.pptx
atharvawafgaonkar
 
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
APNIC
 
PPTX
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
PPTX
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
Parallel & Concurrent ...
yashpavasiya892
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PPTX
Different Generation Of Computers .pptx
divcoder9507
 
PPTX
ENCOR_Chapter_11 - ‌BGP implementation.pptx
nshg93
 
PPTX
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
PPTX
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
PPTX
How tech helps people in the modern era.
upadhyayaryan154
 
PDF
5g is Reshaping the Competitive Landscape
Stellarix
 
PDF
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
PPTX
AI ad its imp i military life read it ag
ShwetaBharti31
 
PPTX
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
MCEAMONVILLAVER
 
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
renavieramopiquero
 
Generative AI Foundations: AI Skills for the Future of Work
hemal sharma
 
ppt lighfrsefsefesfesfsefsefsefsefserrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrt.pptx
atharvawafgaonkar
 
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
APNIC
 
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
Microsoft PowerPoint Student PPT slides.pptx
Garleys Putin
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
Parallel & Concurrent ...
yashpavasiya892
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
Different Generation Of Computers .pptx
divcoder9507
 
ENCOR_Chapter_11 - ‌BGP implementation.pptx
nshg93
 
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
dns domain name system history work.pptx
MUHAMMADKAVISHSHABAN
 
How tech helps people in the modern era.
upadhyayaryan154
 
5g is Reshaping the Competitive Landscape
Stellarix
 
LOGENVIDAD DANNYFGRETRRTTRRRTRRRRRRRRR.pdf
juan456ytpro
 
AI ad its imp i military life read it ag
ShwetaBharti31
 
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
Ad

Php1

  • 1. Introduction Ayub hussein abdulle Msc in CSE University of somalia (UNISO) PHP & MySQL
  • 2.  IntroductionIntroduction  Text Book/Reference MaterialsText Book/Reference Materials  ContentsContents  AssessmentAssessment  QuizQuiz 10%10%  Ass/PRAss/PR 20%20%  Mid Quarter ExamMid Quarter Exam 30%30%  Final ExamFinal Exam 40%40%  Rules of the classRules of the class  Mobiles on “Silent” please MSCMobiles on “Silent” please MSC – CSE, Lecturer: Engr. Ayub– CSE, Lecturer: Engr. Ayub HusseinHussein  ““No class within class” pleaseNo class within class” please
  • 3. Introduction to PHP ● Today’s web user’s expect exciting pages that are updated frequently and provide a customized experience for them. ● Web sites are more like communities to which they will return time and again.
  • 4. Cont. At the same time, website administrators want sites that are easier to update , maintain and understanding , that is the only real way to keep up with visitor’s expectations. For these reasons and more, PHP and MYSQL have become the fact standards for creating dynamic, database-driven websites.
  • 5. PHP History ● 1994: Created by Rasmis Lesdorf, software engineer (part of Apache Team) ● 1995: Called Personal Home Page Tool, then released as version 2 with name PHP/FI (Form Interpreter, to analyze SQL queries) ● Half 1997: used by 50,000 web sites ● October 1998: used by 100,000 websites ● End 1999: used by 1,000,000 websites
  • 6. Alternatives to PHP ● Practical extraction and Report Language (Perl) ● Active Server Pages (ASP) ● Java server pages (JSP) ● Ruby
  • 7. (Good) Topics about PHP ● Open-source ● Easy to use ( C-like and Perl-like syntax) ● Stable and fast ● Multiplatform ● Many databases support ● Many common built-in libraries ● Pre-installed in Linux distributions
  • 8. MySQL ● MySQL is the world’s most popular open- source database. ● MySQL is a database management system (DBMS) for relational databases, therefor MySQL is an RDBMS.
  • 9. Cont.’ ● A database , in the simplest terms is a collection of interrelated data, be it text, numbers or binary files that are stored and kept organized by the DBMS. ● MySQL is an open-source application like PHP, meaning that it is free to use or even modify.
  • 10. Cont.’ ● MySQL software consist of several pieces, including the MySQL server (mysqld which runs & manges the databases ), the MySQL client( mysql, which gives you an interface to the serves ) and numerous utilities for maintenance and other purposes. ● MySQL can handle databases as large as 60,000 tables with more than five billions rows.
  • 11. What you’ll need 1. Web server applications ( e.g. apacha, Abyes or IIS) 2. PHP 3. MySQL 4. A web browser ( e.g. Microsoft’s Internet Explorer and Mozilla’s Firefox ) 5. A text editor, PHP-capable such as Adob’s Dreamweaver qualifies or IDE 6. An FTP application, if using a remote server.
  • 12. How PHP generates HTML/JS Web pages 1: Client from browser send HTTP request (with POST/GET variables) 2: Apache recognizes that a PHP script is requested and sends the request to PHP module 3: PHP interpreter executes PHP script, collects script output and sends it back 4: Apache replies to client using the PHP script output as HTML output 2 Client Browser 1 PHP module3 4 Apache
  • 13. Hello World! (web oriented) <html> <head> <title>My personal Hello World! PHP script</title> </head> <body> <? echo “Hello World!”; ?> </html> PHP tag, allow to insert PHP code. Interpretation by PHP module will substitute the code with code output
  • 14. Sending data to the web bowser ● To create dynamic websites with PHP, you must know how to send data to the web browser. ● PHP has a number of built-in functions for this purpose, the most common being echo( ) and print () ● e.g: echo ‘ Hello world ‘ ; ● All PHP statement must end with semicolon. ● PHP is case-insensitive when it comes to function names, so Echo ( ), echo ( ), eCHo ( ) will all work.
  • 15. Writing Comments ● PHP supports three comments types. ● The first uses the Pound or number symbol ( # ). ● e.g. # this is a comment ● The second uses two slashes. ● e.g. // this is also comment ● Both of these cause PHP to ignore everything that follows untill the end of line, thus these two comments are for single lines only.
  • 16. Cont. A third style allows comments to run over multiple lines. e.g. /* this is a larger comments that spans too lines of comments. */
  • 17. ● Variables are containers used to temporarily store values, these values can be numbers , text or much more complex data. ● PHP has eight types of variables. ● These include four scalar (single –valued) types Bolean ( true or false), integer, floating point (decimals ) and strings (characters ); two nonscalar ( multi-valued) array and object, plus resource (DB) and null (no value). What are variables?
  • 18. Rules of variable ● Regardless of what type you are creating, all variables in PHP follow certain syntactical rules. 1. A variable’s name also called its identifier must start with a dollar sign ($) . E.g. $name 2. The variable’s name can contain a combination of strings, numbers and the underscore. E.g. $My- report1. 3. The first character after dollar sign must be a letter or an underscore ( not be in a number).
  • 19. Cont. ● 4. Variable names in PHP are case –sensitive. ● This is very important rule. It means that $name and $Name are entirely different variables. ● Note: before getting into a script, there are two more things you should know, first , variables can be assigned values using the equal sing ( = ) also called the assignment operator. ● Second , variables can be printed with out quotation mark. E.g.: print $some_var;
  • 20. Cont. ● # variables must be printed within double quotation mark. ● e.g. : print “ Hello, $name “; ● # You can not print variables within single quotation marks. ● e.g. : print ‘ Hello, $name ‘ ; // won’t work.
  • 21. END