WHAT IS PHP<br />PHP is a reflective programming language.<br />Design for producing web pages.<br />PHP is used for serve...
WHY PHP IS USED<br />1.EASY TO USE<br />Code is embeded in HTML .The php code is enclosed in special start and tags that a...
WHY PHP IS USED<br />2.CROSS PLATFORM<br /> WEB SERVERS:  apache,wamp<br /> OPERATING SYSTEM: unix,windows 2000,xp<br /> D...
3.COST BENIFITS<br /><ul><li>PHP IS FREE.
THE ADDON TECHNOLOGIES USED IN PHP ARE ALSO FREE.</li></ul>EXAMPLE:<br />i.software<br />ii.Platform<br />iii.tools<br />
4.FAST & STABLE<br />PHP is server side scripting language hence no additional plugins required.<br />The exicution of php...
BASICS OF PHP<br />*Lines end with semicolon(;).<br />*Code block placed in braces.<br />{<br />   //code;<br />  }<br />*...
BASICS OF PHP<br />*SHORT PHP DELIMETERS<br /><?<br />statement;<br />?><br />*ASSIGN VALUE BY USING ‘=‘ OPERATOR.<br />eg...
BASICS OF PHP<br />*VARIABLE NAME CASE SENSATIVE(NOT STATICALLY TYPED).<br />*ESCAPE SEQUENCE ‘/’.<br />*METHOD<br /> (i) ...
VARIABLE TYPES<br />* BOOLEAN<br />*ARRAY<br />*INTEGER<br />*FLOAT<br />*STRING<br />*OBJECT<br />*DOUBLE<br />
 PHP mail() – send email<br />PHP mail() function is used for sending emails from your website.<br />Syntax of mail() func...
    ECHO in PHP<br />echo is using for output one or more strings in PHP.<br />echo is basically a language construct and ...
   IF STATEMENT<br />“if” statement is one of the most important and most used construct in PHP programming.<br />Its synt...
Array in PHP <br />Array is a special variable which can store multiple value. ( Note : a normal variable can store only o...
FOREACH ARRAY<br />foreach statement is used for making loop over array in loop. It will work only with arrays, and will m...
PHP cookie <br />Cookie is a variable stored in the user computer. Its a mechanism to store the data for future use. Cooki...
DATABASE<br />Database is a computer based record keeping system.<br />Rows in database called tuples.<br />NULL !=0<br />...
KEYS<br />CANDDATE KEYS<br />retrive rows.<br />SUPER KEYS<br />set of candidate keys.<br />PRIMARY KEYS<br />this is uniq...
MYSQL<br />It is a non procedural programming language.<br />QUERIES:<br />>Creating database in sql server<br />   Create...
QUERIES<br />>Insert data into table use college<br />  insert into student values('ashok','34','udaipur','payada')<br />>...
QUERIES<br />>Modify the Structure of table<br />1 Adding new column into table<br />alter table student add pincodeint<br...
QUERIES<br />>ORDER BY<br /> The SQL ORDER BY clause comes in handy when you want to sort     your SQL resultsets by some ...
Upcoming SlideShare
Loading in …5
×

Php

810 views
746 views

Published on

what is PHP?

Published in: Education, Technology
1 Comment
0 Likes
Statistics
Notes
  • IT Pathshala, Noida-Sec-63, offers Guaranteed JOB with PHP Training Programs.

    PAY US ONLY IF YOU GET A JOB!

    CALL US - +91-9871350999 or +91-8800394970

    Technology Centre Address: H-110, Sector-63, Noida (UP)

    Program Highlights:

    - 100% Guaranteed Job – Don’t pay us if you don’t get a JOB!
    - Industry Ready Courses
    - LIVE International Project Experience
    - Exposure to corporate culture at our IT services facility
    - Networking & Interaction with Industry Experts
    - Training provided by reputed IT Company
    - Live Project Source Code made available in CD
    - Technology certification and experience letter at program completion
    - Online Study Content
    Program Takeaways:

    - GUARANTEED JOB in your technology domain
    - Live Major Project development
    - Experience Letter on Training Completion
    - Certification on Training Completion
    - Project Source Code available in CD

    CALL US - +91-9871350999 or +91-8800394970

    Our website: www.itpathshala.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
810
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
13
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Php

  1. 1. WHAT IS PHP<br />PHP is a reflective programming language.<br />Design for producing web pages.<br />PHP is used for server side scripting.<br />PHP is also called ‘HYPERTEXT PREPROCESSER’. <br />
  2. 2. WHY PHP IS USED<br />1.EASY TO USE<br />Code is embeded in HTML .The php code is enclosed in special start and tags that allow you to jump into and out of the php mode.<br />SYNTAX<br /><HTML><br /><TITLE></TITLE><br /><BODY><br /><?PHP<br /> --------------<br />?><br /></BODY><br /></HTML><br />
  3. 3. WHY PHP IS USED<br />2.CROSS PLATFORM<br /> WEB SERVERS: apache,wamp<br /> OPERATING SYSTEM: unix,windows 2000,xp<br /> DATBASES: mysql,oracle<br />
  4. 4. 3.COST BENIFITS<br /><ul><li>PHP IS FREE.
  5. 5. THE ADDON TECHNOLOGIES USED IN PHP ARE ALSO FREE.</li></ul>EXAMPLE:<br />i.software<br />ii.Platform<br />iii.tools<br />
  6. 6. 4.FAST & STABLE<br />PHP is server side scripting language hence no additional plugins required.<br />The exicution of php language is fast.<br />The php is a stable language.<br />
  7. 7. BASICS OF PHP<br />*Lines end with semicolon(;).<br />*Code block placed in braces.<br />{<br /> //code;<br /> }<br />*White space ignored.<br />*Comment<br />//comment(single line)<br />/*<br />------(multiple line)<br />*/<br />
  8. 8. BASICS OF PHP<br />*SHORT PHP DELIMETERS<br /><?<br />statement;<br />?><br />*ASSIGN VALUE BY USING ‘=‘ OPERATOR.<br />eg:<br /> a=5;<br />*PREFIX OPERATOR ‘$’ .<br />*NO NEED TO DEFINE DATA TYPE.<br />
  9. 9. BASICS OF PHP<br />*VARIABLE NAME CASE SENSATIVE(NOT STATICALLY TYPED).<br />*ESCAPE SEQUENCE ‘/’.<br />*METHOD<br /> (i) GET<br /> ($_get)<br /> (ii) POST<br /> ($_post)<br />
  10. 10. VARIABLE TYPES<br />* BOOLEAN<br />*ARRAY<br />*INTEGER<br />*FLOAT<br />*STRING<br />*OBJECT<br />*DOUBLE<br />
  11. 11. PHP mail() – send email<br />PHP mail() function is used for sending emails from your website.<br />Syntax of mail() function is :<br /> mail (to email , Subject of email , email message , header , additional parameters );<br />Here First parameter will be the email address of the receiver<br />Second parameter will be the Subject ( title ) of your email<br />Third parameter will be the content of your email , you can use html tags and all for proper formatting<br />Third parameter is the header of your email, it will contain all the properties and setting for that email , sender email address also should specify in header , we can also add reply to address , format of email etc in header. Using detailed header is a good practice .<br />
  12. 12. ECHO in PHP<br />echo is using for output one or more strings in PHP.<br />echo is basically a language construct and not a function. So we can use without parentheses with it.<br />We can use the HTML formatting tags with PHP echo statement<br />See the following sample program with echo in PHP programs<br /><?php<br />echo "Good Morning"; <br />?> <br />Its out put will be :Good morning<br />
  13. 13. IF STATEMENT<br />“if” statement is one of the most important and most used construct in PHP programming.<br />Its syntax will look like<br />if  (expression){// Operation statements}<br />if statement’s return result will be a Boolean value like TRUE or FALSE.<br />If the expression with “if statement” returns TRUE, the Operation Statements will execute , otherwise it will ignore the statements.<br />
  14. 14. Array in PHP <br />Array is a special variable which can store multiple value. ( Note : a normal variable can store only one value at a time ). Arrays are the oldest and most important data structure which can hold multiple values. Each value in an array is associated with a key. And we can retrieve each value from array using the keys.<br />Arrays can be mainly two types<br />One-dimensional arrays<br />Multidimensional arrays<br />Array in PHP can be categorized as<br />Numeric arrays<br />Associative array<br />Multidimensional array<br />In PHP array can be declared using the construct array()<br />
  15. 15. FOREACH ARRAY<br />foreach statement is used for making loop over array in loop. It will work only with arrays, and will make errors if we try it with other data types.foreach statement can be used in two ways.. See the following two structures of foreach loop in PHP<br />foreach (array as $value){// Operation statement}<br />foreach (array as $key => $value){// Operation statement}<br />Difference between these two syntax are<br />In the first “foreach” statement , value of each array’s element will be assigned to the variable $value<br />In the second “foreach” statement, key of each array’s element will be assigned to the variable $key<br />
  16. 16. PHP cookie <br />Cookie is a variable stored in the user computer. Its a mechanism to store the data for future use. Cookies are part of HTTP header and will passed to the server when the site is accessing in browser.We can use cookies for knowing the return visitors or for storing a value in user computer. In PHP cookie is create using setcookie() function. And this function should be called in your PHP program before any output is sent to the user computer browser .We can store multiple values in a single cookie by declare the cookie as an array ( using [] with cookie variable name ).Here is the syntax for creating a cookiesetcookie (name, value, expiration time , path to store , domain name); <br />Consider a case. In our website there is a form to enter user’s name. And we need to store that name in his computer for next 30 days.Now we need to plan a cookie name for this, and we decided to put the name as “user_name”.<br />
  17. 17. DATABASE<br />Database is a computer based record keeping system.<br />Rows in database called tuples.<br />NULL !=0<br />TYPES:<br />It has two types-<br />i.Centralized<br />ii.Distributed<br />
  18. 18. KEYS<br />CANDDATE KEYS<br />retrive rows.<br />SUPER KEYS<br />set of candidate keys.<br />PRIMARY KEYS<br />this is unique not null.<br />FOREGIEN KEYS<br />join two databases.<br />
  19. 19. MYSQL<br />It is a non procedural programming language.<br />QUERIES:<br />>Creating database in sql server<br /> Create database college<br />>Create table student use college database<br /> create table student<br /> (<br /> name char(25),<br /> age int,<br /> city char(23),<br /> address char(34)<br /> )<br />
  20. 20. QUERIES<br />>Insert data into table use college<br /> insert into student values('ashok','34','udaipur','payada')<br />>Display insert data<br /> select * from student<br />>SQL WHERE command :<br />TheSQL WHERE clause is used to select data conditionally, by adding it to already existing SQL SELECT query.<br />SELECT *<br />FROM Customers<br />WHERE Last_Name = 'Smith'<br />
  21. 21. QUERIES<br />>Modify the Structure of table<br />1 Adding new column into table<br />alter table student add pincodeint<br />2 Delete column name use college<br /> Alter table student drop column pincode<br />3 Delete Database<br /> Drop database databasename<br />
  22. 22. QUERIES<br />>ORDER BY<br /> The SQL ORDER BY clause comes in handy when you want to sort your SQL resultsets by some column(s). For example if you want to select all the persons from the already familiar Customers table and order the result by date of birth, you will use the following statement:<br />SELECT * FROM Customers<br />ORDER BY DOB<br />>AND<br /> The SQL AND clause is used when you want to specify more than one condition inyour SQL WHERE clause, and at the same time you want all conditions to be true.<br />SELECT * FROM Customers<br />WHERE First_Name = 'John' AND Last_Name = 'Smith'<br />
  23. 23. THANK YOU<br />

×