Você está na página 1de 17

SUBMITTED BY: SUBMITTED TO :

ROHIT HANSALIYA MR. GREEN MARAIYA


18EREEC009 HOD : ECE

RAJASTHAN INSTITUTE OF ENGINEERING AND TECHNOLOGY


BHANKROTA, AJMER ROAD, JAIPUR
2019-2020
Content :
Candidate`s declaration

History of php

What is php ?

Features of php

php code look like

php Contents

Advantage of php
Candidate`s Declaration

I,Rohit Hansaliya hereby declare that the Practical Training Report


entitled “PHP with MySql” is my work and neither identical
report has been prepared by me nor the same has been produced
elsewhere for publication purpose to get any award of degree
from any other institution/University.

Rohit Hansaliya
Roll No. 18EREEC009
History of php :

 Created by Rasmus Lerdorf in 1994.


 Originally a set of Perl Scripts used by Lerdorf to
show off his Resume.
What is php ?

 php stands for “Hypertext Preprocessor” .


 An open source language .
 php is a server – side scripting language .
 php is used to generate dynamik web pages .
 Php code can be embedded within an HTML page .
What is php ?

 ‘View Sourse’ in browsers does not display


the php code .
 php supports many popular databases such
as MySql , Oracle and many more .
Features of php :
 Very Efficient :- Can serve million of hits
per day .
 Database Integration :- Supports many
databases, such as MySql and Oracle.
 It’s Free :- Available on http://www.php.net
 Easy to Learn :- Very similar in syntax to c
and c++
 php uses both procedural and object
oriented paradigms .
Php codes look like ?
 Each php script must be enclosed in the reserved
php tag .

<?php

….

?>
Example of Php code

<?php
$link = mysql_connect('localhost', 'root',
'Jodhpur@123');
$db = mysql_select_db('wd');
// Check connection
if($link == false){
die("ERROR: Could not connect. " .
mysqli_connect_error());
}
?>
Php Contents :
• Variables
• Constant
• Operators
• Array
• Functions
Variables :
Variables are used for storing values, such as
numbers, strings or function results, so that they can
be used many times in a script.
PHP variables must begin with a “$” sign
PHP variables are case –sensitive ($sign!=$sign
!=$sign)
Certain variable names reserved by PHP like form
variables
($_POST,$_GET), server variables
($_server),etc.
Operators :
•Arithmetic Operators (+,-,*,/)
•Example:- $total=$a+$b;

•Assignment Operators(=)
•Example :- $t=$a+$b;

•Comparison Operators (<,<=,>,>=)


•Logical Operators (&&,||,!!)
Arrays :
<?php
$arr =array(“somearray”=>?
array(6=>, 13=>9, “a”=>42));
echo $arr[“somearray”][6]; //
5
echo $arr[“somearray”][; //
9

?>
Functions :

•Function must be defined before then can be called


•Function headers are of the formate
•Function
Functionname($arg1,$arg2,…….$argn)
•Note that no return typeis specified
Function Example :

<?php
function mul($arg1,$arg2)
{
$arg2=$arg1*$arg2;
return $arg2;
}
$result = mul(12,3); //Store the
function
echo $result1; //Output 36
?>
Advantage of PHP :

Open source
Procedural/Object Oriented Programming
Supports wide rang of Databases
Easy to learn
Portable
THANK YOU

Você também pode gostar