Source code of dbFindAverageGood1.php

<html>
<head>
<title>Find Average Item Price</title>
</head>
<body>
<h2>Find Average Item Price</h2>

<?php
  $lines 
file("mysql.txt");
  
$password trim($lines[0]);
  
$dbLink mysql_connect("localhost""tboegel"$password);

  
mysql_select_db("clearwater"$dbLink);

  
$query "SELECT avg(inv_price) as average_price FROM inventory";

  
$recordset mysql_query($query$dbLink);

  
$row mysql_fetch_assoc($recordset);

  
$average $row['average_price'];

  print 
"<p>The average price of items in our inventory is $average</p>";

?>
</body>
</html>