1 of 36

Subject:�PHP, MySQL, Wordpress�

2 of 36

3 of 36

PHP introduction

  • PHP is a recursive acronym for

PHP Hypertext Pre-processor

  • PHP originally stood for Personal Home Page
  • It was originally created by Rasmus Lerdorf 

in 1994

4 of 36

PHP introduction

  • It is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
  • Executes entirely on the server, requiring no specific features from the client

5 of 36

PHP introduction

  • PHP is a server-side scripting language
  • PHP scripts are executed on the server
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)‏
  • PHP is open source software
  • PHP is free to download and use

6 of 36

PHP introduction

  • PHP runs on different platforms (Windows, Linux, Unix, etc.)‏
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)‏
  • PHP is FREE to download from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

7 of 36

PHP introduction

  • PHP pages contain HTML with embedded code that does "something“
  • PHP code is enclosed in special start and end processing instructions

<?php and ?> that allow you to jump into and out of "PHP mode.

  • PHP PHP files have extension ".php"

8 of 36

Our first PHP program

9 of 36

PHP introduction

  • PHP code is executed on the server, generating HTML which is then sent to the client.
  • The client would receive the results of running that script, but would not know what the underlying code was.

10 of 36

PHP introduction

11 of 36

PHP introduction

Adding Comments to a PHP Script

  • Comments are nonprinting lines placed in code
  • Line comments hide a single line of code

// or # before the text

  • Block comments hide multiple lines of code

/* to the first line of code

and */ after the last character in the code

12 of 36

PHP introduction

13 of 36

Features of PHP

  • Simple
  • Interpreted
  • Faster
  • Open Source
  • Platform Independent
  • Error Reporting
  • case sensitive
  • Real-Time Access Monitoring
  • Loosely Typed Language

14 of 36

Features of PHP

  • Simple

It is very simple and easy to use, compare to other scripting language it is very simple and easy, this is widely used all over the world.

  • Interpreted

It is an interpreted language, i.e. there is no need for compilation.

15 of 36

Features of PHP

  • Faster

It is faster than other scripting language e.g. asp and jsp.

  • Open Source

Open source means you no need to pay for use php, you can free download and use.

16 of 36

Features of PHP

  • Platform Independent

PHP code will be run on every platform, Linux, Unix, Mac OS X, Windows.

  • case sensitive
    • PHP is case sensitive scripting language at time of variable declaration.
    • In PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive.

17 of 36

Features of PHP

  • In PHP, all keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are NOT case-sensitive.

18 of 36

Features of PHP

  • Error Reporting

PHP have some predefined error reporting constants to generate a warning or error notice.

  • Real-Time Access Monitoring

PHP provides access logging by creating the summary of recent accesses for the user.

19 of 36

Features of PHP

  • Loosely Typed Language
  • PHP supports variable usage without declaring its data type. It will be taken at the time of the execution based on the type of data it has on its value.

20 of 36

Advantages of PHP

  • Open source: It is developed and maintained by a large group of PHP developers, this will helps in creating a support community, abundant extension library.
  • Speed: It is relative fast since it uses much system resource.

21 of 36

Advantages of PHP

  • Easy to use: It uses C like syntax, so for those who are familiar with C, it's very easy for them to pick up and it is very easy to create website scripts.
  • Stable: Since it is maintained by many developers, so when bugs are found, it can be quickly fixed.

22 of 36

Advantages of PHP

  • Powerful library support: You can easily find functional modules you need such as PDF, Graph etc.
  • Built-in database connection modules: You can connect to database easily using PHP, since many websites are data/content driven, so we will use database frequently, this will largely reduce the development time of web apps.

23 of 36

Advantages of PHP

  • Can be run on many platforms, including Windows, Linux and Mac, it's easy for users to find hosting service providers.

24 of 36

Disadvantages of PHP

  • Security : Since it is open sourced, so all people can see the source code, if there are bugs in the source code, it can be used by people to explore the weakness of PHP.
  • Not suitable for large applications: Hard to maintain since it is not very modular.

25 of 36

Disadvantages of PHP

  • Weak type: Implicit conversion may surprise unwary programmers and lead to unexpected bugs. For example, the strings "1000" and "1e3" compare equal because they are implicitly cast to floating point numbers.

26 of 36

MySQL introduction

27 of 36

MySQL introduction

  • MySQL is a database server
  • MySQL is ideal for both small and large applications
  • MySQL supports standard SQL
  • MySQL compiles on a number of platforms
  • MySQL is free to download and use

28 of 36

A brief history of MySQL

  • MySQL is an open source relational database management system (RDBMS).
  • Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language.
  • The first version of MySQL appeared on 23 May 1995.
  • MySQL is written in C and C++. 

29 of 36

Features of MySQL

  • Relational Database Management System (RDBMS): MySQL is a relational database management system.
  • Easy to use: MySQL is easy to use. You have to get only the basic knowledge of SQL. You can build and interact with MySQL with only a few simple SQL statements.

30 of 36

Features of MySQL

  • It is secure: MySQL consist of a solid data security layer that protects sensitive data from intruders. Passwords are encrypted in MySQL.
  • Client/ Server Architecture: MySQL follows a client /server architecture. There is a database server (MySQL) and arbitrarily many clients (application programs), which communicate with the server; that is, they query data, save changes, etc.

31 of 36

Features of MySQL

  • Free to download: MySQL is free to use and you can download it from MySQL official website.
  • It is scalable: MySQL can handle almost any amount of data, up to as much as 50 million rows or more. The default file size limit is about 4 GB. However, you can increase this number to a theoretical limit of 8 TB of data.

32 of 36

Features of MySQL

  • Compatibale on many operating systems: MySQL is compatible to run on many operating systems, like Novell NetWare, Windows* Linux*, many varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2, FreeBSD*, and others. MySQL also provides a facility that the clients can run on the same computer as the server or on another computer (communication via a local network or the Internet).

33 of 36

Features of MySQL

  • Allows roll-back: MySQL allows transactions to be rolled back, commit and crash recovery.
  • High Performance: MySQL is faster, more reliable and cheaper because of its unique storage engine architecture.
  • High Flexibility: MySQL supports a large number of embedded applications which makes MySQL very flexible.

34 of 36

Features of MySQL

  • High Productivity: MySQL uses Triggers, Stored procedures and views which allows the developer to give a higher productivity.
  • Stored procedures, using a procedural language that closely adheres to SQL/PSM
  • Triggers
  • Cursors
  • Updatable views

35 of 36

Disadvantages of MySQL

  • MySQL version less than 5.0 doesn't support ROLE, COMMIT and stored procedure.
  • MySQL does not support a very large database size as efficiently.
  • MySQL doesn't handle transactions very efficiently and it is prone to data corruption.

36 of 36

Disadvantages of MySQL

  • MySQL is accused that it doesn't have a good developing and debugging tool compared to paid databases.
  • MySQL doesn't support SQL check constraints.