What is PHP?

PHP is a worker side scripting language, particularly appropriate for the production of dynamic pages. This programming language offers web designers a huge determination of instruments. PHP, which has become the reason for some web applications, permits simple inclusion in HTML code and association with MySQL and PgSQL Databases.




What is SQL?

In the event that you are asking yourself what makes the data on the sites so efficient and powerfully created as we peruse through the different website pages, executing different snap, select, download, and so forth activities, the appropriate response is basic - the SQL (Structured Query Language) information bases. A SQL information base is an organized assortment of information. The substance of the SQL information base can be anything from a cooking formula to a picture display or the tremendous measures of data in a corporate organization. To include, access, and cycle information put away in a PC information base, you need an information base administration framework. Since PCs are truly adept at dealing with a lot of information, information base administration frameworks assume a focal function in figuring, as independent utilities, or as parts of different applications. To include speed and adaptability, social information base administration frameworks (RDBMS, for example, MySQL, store information in discrete tables as opposed to placing all the information in one major storeroom. Sites which use information bases have numerous points of interest. They give organized, effectively open and editable substance, accessible to numerous clients. Likewise on the grounds that the greater part of the data is put away in the information base the substance can be effortlessly moved or traded to another web application, new web worker or a more up to date form of the last mentioned.

Why use MySQL?

The most broadly utilized kind of SQL information base on the World Wide Web today is MySQL. As the most well known Open Source SQL information base administration framework, MySQL is created, disseminated, and upheld by MySQL AB. Since MySQL is lightweight, open source-based and free, it is an establishment for some novice, non-expert, or open source ventures like Joomla, Wordpress, 4images and PHPBB3. Shockingly, MySQL doesn't give the more elevated level of security regular of costly undertaking class information base arrangements, for example, Oracle, MsSQL, Sybase, however it gives a safe, quick and dependable enough data set help which is actualized in numerous expert web conditions.

MySQL information bases are favored over the restrictive information base frameworks because of their unwavering quality and speed of execution. They are most ordinarily utilized for both customary and inserted Web applications running on UNIX, Windows and Mac OS. MySQL is the ideal information base programming for both moderately stacked sites and high-traffic web-based interfaces. Contingent upon the reason and size of your site - you may require somewhere in the range of 1 and 9999 MySQL information bases.

How to install MySQL? 

MySQL deals with a wide range of working frameworks, including Windows, Linux, BSD, Mac OSX and then some. Something which make MySQL truly well known is the basic mix with PHP (one of the most utilized web improvement dialects).


The start of PHP and PHP 3 

PHP was made in 1995 by Rasmus Lerdorf and means Personal Home Page language. Since the time its starting it has been one of the most natural programming dialects utilized for the formation of dynamic website pages. Afterward, when the PHP group was framed, the parser was revised and PHP adaptation 3.0 came around. The PHP 3 adaptation was the principal genuine improvement of the PHP language, which fixed a ton of bugs and totally upgraded the PHP center. The significance of the shortening was likewise changed to PHP Hypertext Preprocessor.

Let's see, for example, a sample PHP code, which relays on the Echo command to display "Hello World!":

<?php
echo 'Hello World!';
?>

One of the most notable advantages of the PHP language is its ability to easily interact with databases. Below you can see an example PHP manipulating with mySQL databases.

<?php
// Connecting, selecting database
$link = mysql_connect('dbhost', 'dbuser', 'dbpassword')
    or die('Could not connect: ' . mysql_error());
mysql_select_db('my_database');

// Performing SQL query
$query = 'SELECT name, qty, price FROM products';
$result = mysql_query($query)
    or die('Query failed: ' . mysql_error());

// Printing result
while ($row = mysql_fetch_assoc($result)) {
    echo "Product:".$row['name']
        .", Quantity:".$row['qty']
        .", Price:".$row['price']."<br>";
}

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>


Create a PHP program to display the bio data of a person by reading the person details using HTML

When constructing a mind boggling page, sooner or later you will be confronted with the need to consolidate PHP and HTML to accomplish your required outcomes. From the outset point, this can appear to be confounded, since PHP and HTML are two separate dialects, yet this isn't the situation. PHP is intended to associate with HTML and PHP contents can be remembered for a HTML page without an issue. 
In a HTML page, PHP code is encased inside exceptional PHP labels. At the point when a guest opens the page, the worker measures the PHP code and afterward sends the yield (not simply the PHP code) to the guest's program. In reality it is very easy to incorporate HTML and PHP. A PHP content can be treated as a HTML page, with pieces of PHP embedded to a great extent. Anything in a PHP content that isn't contained inside <?php ?> labels is overlooked by the PHP compiler and passed straightforwardly to the internet browser. In the event that you take a gander at the model underneath you can perceive what a full PHP content may resemble:

<head></head>
<body class="page_bg">
Hello, today is <?php echo date('l, F jS, Y'); ?>.
</body>
</html>

The code above is basically HTML, with a tad of PHP that prints out the present date utilizing the inherent date work. As referenced over, the entirety of the plain HTML in the code above will be disregarded by the PHP compiler and went through to the internet browser immaculate. 
Perceive how simple that is? Incorporating PHP and HTML is actually quite basic. Simply recollect that at its center, a PHP content is only a HTML page with some PHP sprinkled through it. In the event that you need, you can make a PHP content that just has HTML in it and no <?php ?> labels, and it will work fine and dandy.

PHP in HTML utilizing short_open_tag 


In the event that you need to abbreviate your code however much as could be expected, you can go for the short_tags choice. This will spare you from composing <?php toward the start of the code, shortening it to simply <?. So as to empower this, you should refresh the php.ini record and turn the "short_tags" setting from "Off" to "On". While on most workers this setting is now turned on, it's in every case best to check already. A difficult that can happen if utilizing short labels is a contention with the XML utilization. For XML, the <? sentence structure will begin a preparing capacity. To dodge this issue, the other option <?= tag can be utilized.