天天看點

PHP輔導代做程式設計:CS353 Database System

Requirement

Prior to beginning tis assignment, please download the studentsdb.sql, studentdb.pdf and the Index.php file from the course web site.

In this assignment, you are to complete the php script, Index.php, which will use the values input by the user. This script contains one push botton and one textbox in order to perform the interaction.

The web page should provide the following functions:

  1. Connect to the database
  2. Check if the database connection is successful
  3. Validation on user typing
  4. Search and display the query result of each student
  5. Error message if no student found

Analysis

Tips

<?php
...
$conn = mysql_connect("localhost", "root", "123456");
if (!$conn) {
  // connection failed
  echo "Could not connect to database: " . mysql_error();
}
// connection successful
...
mysql_close($conn)
?>
複制代碼