Php Training Workshop by Vtips

691 views

Published on

The PHP training course offered by us is simply the best. The study materials and course modules are designed in a less complicated manner which can easily be understood by the students.

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

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

No notes for slide

Php Training Workshop by Vtips

  1. 1. PHP Made by:Nupoor Garg M-tech(CSE) Professional Training Institute
  2. 2. BRIEF HISTORY
  3. 3. PHP FULL FORMS
  4. 4. DEFINITION PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content in your website.
  5. 5. WAMP SERVER
  6. 6. "Hello World" Script in PHP <HTML> <HEAD> <TITLE> First program <TITLE> <BODY> <BODY> </HTML> HELLO WORLD! <?php echo "Hello, World!"; </HEAD> </BODY ?>
  7. 7. VARIABLES IN PHP All variables are declared with leading dollar($) sign. $vary=34; $many=5.34; Variable can, but do not need to be declared before assignment. PHP does a good job of automatically converting types from one to another when necessary. $sum=34; $sum=“hiii”;
  8. 8. OPERATORS Arithmetic Operators Logical (or Relational) Operators Assignment Operators Conditional (or ternary) Operators
  9. 9. DATE FUNCTION IN PHP • date(format) EXAMPLE:DATE( ); • Print date with time EXAMPLE:DATE( “d-m-y h:m:s” );
  10. 10. Time zones • To set the time zone date_default_timezone_set(); • To get the time zone date_default_timezone_get();
  11. 11. ARRAYS IN PHP • Numeric array An array with a numeric index. Values are stored and accessed in linear fashion • Associative array An array with strings as index. This stores element values in association with key values rather than in a strict linear index order.
  12. 12. Example (Numeric arrays) • <?php $cars=array("Volvo","BMW","Toyota"); • Echo “I like”.$cars[2]; • ?>
  13. 13. Example (associative array) • • • • • • • • • • <html> <body> <?php $salaries['mohammad'] = "high"; $salaries['qadir'] = "medium"; $salaries['zara'] = "low"; echo "Salary of qadir is ". $salaries['qadir']."<br/>"; ?> </body> </html>
  14. 14. HEADER,INCLUDE AND REQUIRE • HEADER IT IS USED TO REDIRECT TO ANOTHER PAGE. • INCLUDE IT IS USED TO INCLUDE THE ANOTHER PAGE INTO THE CURRENT PAGE. • REQUIRE SAME AS INCLUDE.
  15. 15. STEP 1 :- TO ESTABLISH CONNECTION mysql_connect(host,username,password,databasename); <? PHP $LINK=MYSQL_CONNECT(“LOCALHOST”,”ROOT”,””,”myd”); IF($LINK) { ECHO “CONNECTION ESTABLISHED” }
  16. 16. MYSQL BASIC QUERIES • TO CREATE DATABASE CREATE DATABASE DB_NAME; • TO CREATE TABLE CREATE TABLE TB_NAME(COL_NM1 DATATYPE,COL_NM2 DATATYPE……); • TO LIST THE DATA SELECT * FROM TABLE_NAME;
  17. 17. • TO INSERT VALUES IN TABLE INSERT INTO TABLE_NAME VALUES(VALUE1,VALUE2……..VALUEN);
  18. 18. QUERIES TO BE USED WITH MYSQL • MYSQLI_CONNECT(); • The mysqli_connect() function opens a MySQL connection. • This function returns the connection on success, or FALSE on failure.
  19. 19. CONT.. • MYSQLI_QUERY($CON,”QUERY”); • MYSQLI_CLOSE($CON); • Closes a previously opened database connection
  20. 20. FETCHING DATA FROM MYSQL DATABASE
  21. 21. ORDER BY RAND() FUNCTION IN MYSQL • MySQL has a ORDER BY RAND() function that can be used to randomize the set of values. • SYNTAX • SELECT * FROM TABLE_NAME ORDER BY RAND();
  22. 22. WORDPRESS WordPress is a free and open source blogging tool and a contentmanagement system based on PHP and MySQL. WordPress is an OPEN SOURCE project, which means there are hundreds of people all over the world working on it. WordPress started as just a blogging system, but has evolved to be used as full content management system and so much more through the thousands of plugins and widgets and themes. WordPress is limited only by your imagination.
  23. 23. Learn Php in Delhi

×