PHP is a server side running programming. That is why when you go to someones site who is using PHP and View Source you see nothing but html. When you program something in PHP you have to have software installed on the server where you site will be hosted before it will even do anything. Think of it like this when someone calls up your php this is what happens with it:
When a page is requested by a web surfer, the page is first ran through the PHP Paser on the server. Then it is sent down to the client after it has been parsed into HTML.
PhpCode.php --> PHP Parser converted to HTML --> Client
Thats why when you write php code you need to began any PHP code with <? and end it with ?>. This is how the parser knows when to start parsing and when to just ignore the code. Let say below is a php page in which you are coding.
PHP CODE EXAMPLE______
Code:
EXAMPLE
[php]<?
echo "This is my php code!!";
echo "
This is a single rowed, single celled table! |
";
for($i=0; $i == 5 ; $i++)
{
echo $i . "
";
}
?>[/php]
Code:
Then when the page is called through the web browser and if you were to View Source this is what you would see___
Code:
<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>
This is my php code!!
<TABLE><TR><TD>This is a single rowed, single celled table!</TD></TD></TABLE>
1<BR>
2<BR>
3<BR>
4<BR>
5<BR>
</BODY>
</HTML>
MySQL is a type of SQL database management. To make a site dynamic you need to be able to store information. You use MySQL to do this. You use MySQL to orginize the content of your site. If you had a table in your database that was used to keep address and you had the fields
ID City State… Through PHP and MySQL you can output to a page all the Citys Under a certian state or ID. Or a Certain state associated with a id…and so and so forth.
Hope that helps clearify things for you.