Interesting question; I'll do my best to provide some sort of answer. Hopefully it will help.
PHP is used to add "dynamic" content to a website. Let's create an example to help show the difference between "static" and "dynamic" and (hopefully) use it to help explain PHP and MySQL.
First, let's start with a "static" HTML page:
<html>
<head>
<title>PHP Example #1</title>
</head>
<body>
<p>This is a bunch of static text.</p>
</body>
</html>
When a USER calls this webpage, the browser will display a very simple message: "This is a bunch of static text". No matter how many users access this webpage, the content will be the same, and if the same user calls the website next week, it will remain the same.
Second, let's add some simple "dynamic" PHP content:
<html>
<head>
<title>PHP Example #2</title>
</head>
<body>
<p>The server time is: <?php echo date('l jS \of F Y h:i:s A'); ?></p>
</body>
</html>
When a USER calls this page, the browser will display something like: "The server time is: Tuesday 20th of May 2008 03:00:13 PM". Now, each time a USER calls this page, the current date/time will be displayed. In other words, the content of the webpage will now change ("dynamically").
You can use a Database (such as MySQL, Postgre, Oracle, etc) to hold information.
Third, let's assume we create a "login" page where a USER enters a Username/Password to access a webpage. The Database holds a few favorite links for each user - the page we are creating will display the list of links for the logged in user.
<?php
// Get current user from session
$userID = $_SESSION['userID'];
$dbLinks=array();
// Connect to the DB
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Not connected : ' . mysql_error());
}
// Access the DB
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
// Query the DB
$query = "SELECT `link` FROM `LinksTable` WHERE `userID`=$userID";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
$dbLinks[] = $row['link'];
}
// Close the DB
mysql_close($link);
?>
<html>
<head>
<title>PHP Example #3</title>
</head>
<body>
<p>Your Favorite Links:</p>
<?php
foreach($dbLinks as $val) {
echo "<a href='$val'>$val</a><br>";
}
?>
</body>
</html>
Now, my code is really quick and dirty, but you can see that PHP is dynamically changing the contents of the webpage. "Joe" will have listed his 5 favorite comedy websites; where "Jane" will have listed her 8 favorite PHP resource pages.