前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >PHP辅导代做编程:CS353 Database System

PHP辅导代做编程:CS353 Database System

原创
作者头像
拓端
发布2022-10-26 18:17:52
2540
发布2022-10-26 18:17:52
举报
文章被收录于专栏:拓端tecdat拓端tecdat

全文链接:tecdat.cn/?p=29678

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

本题需要实现一个简易的基于网页的查询功能,包括连接数据库、数据库查询、处理用户输入、异常处理。用户的交互部分已经由Index.php提供,我们需要做的是完善它的逻辑。 本题难点在于调试部分,建议一边实现一边调试,并在关键地方打印变量值来进行调试。

Tips

下面给出数据库连接部分代码,默认数据库为本地mysql,用户名为root,密码为123456

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

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 全文链接:tecdat.cn/?p=29678
    • Requirement
      • Analysis
        • Tips
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档