+ All Categories

Download - PHP and MySQL

Transcript
Page 1: PHP and MySQL

PHP and MySQL

Page 2: PHP and MySQL

Some Basic Concepts

• Webpages and Website• Web Application: Design And Development• Design- HTML,CSS and other design concepts• Development- Scripting !• Client-Server Architecture

Page 3: PHP and MySQL

Static & Dynamic Pages?

Page 4: PHP and MySQL

Dynamic Pages

• A dynamic web page is a kind of web page that has been prepared with fresh information (content and/or layout), for each individual viewing. It is not static because it changes with the time (e.g. news content), the user (e.g. preferences in a login session), the user interaction (e.g. web page game), the context (e.g. parametric customization), or any combination thereof.

Page 5: PHP and MySQL

Server-side Scripting• It is a web server technology in which a user's request

is fulfilled by running a script directly on the web server to generate dynamic web pages.

• It is usually used to provide interactive web sites that interface to databases or other data stores.

• This is different from client-side scripting where scripts are run by the viewing web browser, usually in JavaScript.

• The primary advantage to server-side scripting is the ability to highly customize the response based on the user's requirements, access rights, or queries into data stores.

Page 6: PHP and MySQL

Some scripting languages:

• PHP (*.php)• JavaServer Pages(*.jsp)• ASP• ColdFusion Markup Language (*.cfm)• Perl (*.pl)• SMX (*.smx)• Python (*.py)• Ruby (*.rb)• Lasso (*.lasso)• WebDNA (*.dna,*.tpl)

Page 7: PHP and MySQL
Page 8: PHP and MySQL

Apache- The PHP web Server

• Apache (By ASF) is THE webserver with complete PHP support

• Notable for playing a key role in the initial growth of the World Wide Web. In 2009, it became the first web server software to surpass the 100 million website milestone

• Works with almost any OS• Apache was estimated to serve 63% of all

websites and 66% of the million busiest.

Page 9: PHP and MySQL
Page 10: PHP and MySQL

Where?

Page 11: PHP and MySQL

Facebook

Page 12: PHP and MySQL

Wikipedia

Page 13: PHP and MySQL

PHP: Hypertext Preprocessor

• Born on June,1995. • Widely used, general-purpose scripting language• Was originally designed for web development to

produce dynamic web pages.• These scripts were written as C programming

language Common Gateway Interface(CGI) binaries, extending them to add the ability to work with web forms and to communicate with databases and called this implementation 'Personal Home Page/Forms Interpreter' or PHP/FI.

Page 14: PHP and MySQL

PHP supports many DBMSs…

• MySQL• Informix• Oracle• Sybase• Solid• PostgreSQL• Generic ODBC etc.

Page 15: PHP and MySQL
Page 16: PHP and MySQL

MySQL

• Initially released on May, 1995.• MySQL is a relational database management

system (RDBMS) that runs as a server providing multi-user access to a number of databases.

• Written in C,C++ !

Page 17: PHP and MySQL

• Wikipedia-depends upon the LAMP platform• Uses an array of 5 MySQL servers • Processes 200 million+ queries• 2 million updates daily• Illustrative of MySQL’s capabilities in a high

read and high write environment

Page 18: PHP and MySQL

• Yahoo! Operates on the FreeBSD platform,an open source Unix variant

• http://finance.yahoo.com/ uses FreeBSD and MySQL back end

• Billions of Monthly usage. (Yes, Billions)

Page 19: PHP and MySQL

Why PHP and MySQL?

• Childhood Friends • Free and powerful• Written in C,C++. This Combination makes

implementations faster

Page 20: PHP and MySQL

More importantly…

• because of the stability, • the lower server costs (Linux Servers - Apache

HTTP Servers) than hosting .• Net applications • and the availability of ready to use Open

Source Software Applications on the Internet.

Page 21: PHP and MySQL

LAMP

Page 22: PHP and MySQL

Are you ready to code?

If(lamp||xampp)return true;

elseIf(apache && mysql==true)

return true;else

Visit GLOSS website !!

Page 23: PHP and MySQL

Talk is cheap. Show me the code

-By ???

Page 24: PHP and MySQL

PHP Basics<?php

/*code here */echo “Hello World” ; //end with ;?>

•Weakly Typed, $var_name = value; •Arithmetic, Assignment, Comparison, Logical operators.•Conditionals and loops – Same as C. Just use echo “ print this !“; //instead of printf()•Functions:

function functionName() { code to be executed; } //Call using function name

Page 25: PHP and MySQL

SQL Basics

• Either use the GUI (Say phpMyAdmin, MySQL query browser), form or menu based systems or

• Use SQL scripts.

Page 26: PHP and MySQL

PHP-MySQL Connectivity

• Follow these steps– Connection //mysql_connect()– Creation/Selection //mysql_select_db()– Query //mysql_query()– Connection Close //mysql_close()

Page 27: PHP and MySQL

Want More??

Use Existing PHP frameworks to code faster and clear for Real-Time

Applications

Page 28: PHP and MySQL

PHP Frameworks

• CakePHP• Zend• Symfony• CodeIgnitor• Akelos• Recess• PRADO

Page 29: PHP and MySQL

Online Resources

• HTML – http://htmlhelp.com/reference/html40• PHP – http://www.php.net/manual/en• PHP Libraries• http://en.wikipedia.org/wiki/List_of_PHP_libraries• MySQL – http://dev.mysql.com/doc/refman/5.0/en/• BROWSER – View Page Source• http://www.w3schools.com/• OpenSource Applications – http://sourceforge.net/• And,of course,GOOGLE!!!! – whatever you want is

out there

Page 30: PHP and MySQL

Now, What Next??

Why PHP is preferred than ASP?Is PHP object-oriented or procedural?

Learn advanced topics on PHP and MySQL

Page 31: PHP and MySQL

Opportunities?

Page 32: PHP and MySQL
Page 33: PHP and MySQL

And finally…

//Build your own “Dynamic Web Application”//

Page 34: PHP and MySQL

Adios!

Feel free to contact me @

[email protected]

facebook.com/manigandan.balachandran

twitter.com/manigandan_b

Manigandan,B III CSE +91 9677216418


Top Related