instead of => (4 points)
// Line 52: $ missing from $value when printing table (4 points)
//
// Additional points were given if non-critical errors were found
// and corrected.
print "";
?>
Movie Database Access
Results of a search on '{$search_str}'";
// Make the connection to the database through the bogus account zxyx999 with password
// 12345. The username and password should work okay and should not need changed.
$connection = mysql_connect ("localhost", "zxyx999", "12345");
mysql_select_db("zxyx999", $connection);
// Perform the query on the database
$result = mysql_query("SELECT * FROM movie_inventory where NAME like '%{$search_str}%' order by NAME", $connection);
// Initialize a counter to count through all of the records
$count=0;
// Print the starting tag for the table
print "";
while($record = mysql_fetch_array($result, MYSQL_ASSOC))
{
// If we are still on the first record, print the table headings as the field names
if($count==0)
{
print "";
foreach($record as $index=>$value)
print "{$index} | \n";
print "
";
}
// Now print the fields for each record
$count++;
print "";
foreach($record as $index=>$value)
print "{$value} | \n";
print "
";
}
// Print the ending tag for the table
print "
";
// Close the database connection
mysql_close ($connection);
?>