季雨 發表於 2020-5-28 18:27:00

php连接SqlServer并实现增删改查

<h2><strong><span style="font-family: 宋体; font-size: 14pt">一、配置环境</span></strong></h2>
<p><span style="font-family: 宋体; font-size: 16px">  1、配置好SqlServer的登录名:sc。参考:https://jingyan.baidu.com/article/8cdccae9452b3c315513cd52.html</span></p>
<p><span style="font-family: 宋体; font-size: 16px">  2、下载 php_pdo_sqlsrv_74_ts_x64.dll&nbsp;和&nbsp;php_sqlsrv_74_ts_x64.dll两个文件并放到&nbsp;php&nbsp;的ext目录下。下载地址:https://www.zhaodll.com/dll/p/201905/343232.html</span></p>
<p><span style="font-family: 宋体; font-size: 16px">  3、在你的php.ini文件中加上</span></p>
<div class="cnblogs_code">
<pre><span style="font-family: 宋体; font-size: 16px">extension=<span style="color: rgba(0, 0, 0, 1)">php_pdo_sqlsrv_74_ts_x64.dll
extension</span>=php_sqlsrv_74_ts_x64.dll</span></pre>
</div>
<p><span style="font-family: 宋体; font-size: 16px">  4、重启Apache服务器。</span></p>
<p><span style="font-family: 宋体; font-size: 16px">  5、测试:</span></p>
<div class="cnblogs_code">
<pre><span style="font-family: 宋体; font-size: 16px"><span style="color: rgba(128, 0, 128, 1)">$serverName</span> = "localhost"; <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库服务器地址</span>
<span style="color: rgba(128, 0, 128, 1)">$uid</span> = "sa";   <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库用户名</span>
<span style="color: rgba(128, 0, 128, 1)">$pwd</span> = "lxy208751"; <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库密码</span>
<span style="color: rgba(128, 0, 128, 1)">$connectionInfo</span> = <span style="color: rgba(0, 0, 255, 1)">array</span>("UID" =&gt; <span style="color: rgba(128, 0, 128, 1)">$uid</span>, "PWD" =&gt; <span style="color: rgba(128, 0, 128, 1)">$pwd</span>, "Database" =&gt; "Students"<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(128, 0, 128, 1)">$conn</span> = sqlsrv_connect(<span style="color: rgba(128, 0, 128, 1)">$serverName</span>, <span style="color: rgba(128, 0, 128, 1)">$connectionInfo</span><span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(0, 0, 255, 1)">if</span> (<span style="color: rgba(128, 0, 128, 1)">$conn</span> == <span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">) {
    </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "连接失败!"<span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(0, 128, 128, 1)">var_dump</span><span style="color: rgba(0, 0, 0, 1)">(sqlsrv_errors());
    </span><span style="color: rgba(0, 0, 255, 1)">exit</span><span style="color: rgba(0, 0, 0, 1)">;
} </span><span style="color: rgba(0, 0, 255, 1)">else</span><span style="color: rgba(0, 0, 0, 1)"> {
    </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "链接成功"<span style="color: rgba(0, 0, 0, 1)">;
}</span></span></pre>
</div>
<p><span style="font-family: 宋体; font-size: 16px"><img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528181914188-1303924672.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<h2><strong><span style="font-family: 宋体; font-size: 14pt">二、编码设置</span></strong></h2>
<p><span style="font-family: 宋体; font-size: 16px">(注:由于sql server 不支持UTF8,当使用varchar保存汉字时,会出现乱码。需要转换。)</span></p>
<p><span style="font-family: 宋体; font-size: 16px">  1、从数据库查出来的数据编码“GBK”,一般我们有的是“UTF-8”,所以需要转换成“UTF-8”。</span></p>
<div class="cnblogs_code">
<pre><span style="font-family: 宋体; font-size: 16px"><span style="color: rgba(0, 0, 255, 1)">function</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('GBK', 'UTF-8', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}</span></span></pre>
</div>
<p><span style="font-family: 宋体; font-size: 16px">  2、从程序代码中的变量插入的数据库时,需要将变量的编码改成“GBK”才能插入数据库。</span></p>
<div class="cnblogs_code">
<pre><span style="font-family: 宋体; font-size: 16px"><span style="color: rgba(0, 0, 255, 1)">function</span> toGBK(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('UTF-8', 'GBK', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}</span></span></pre>
</div>
<h2><strong><span style="font-family: 黑体; font-size: 14pt">三、学生信息管理系统</span></strong></h2>
<p><span style="font-family: 宋体; font-size: 16px">  1、index.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_eb7e6582-1054-4c49-8589-c7d73b451f34" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_eb7e6582-1054-4c49-8589-c7d73b451f34" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_eb7e6582-1054-4c49-8589-c7d73b451f34" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php

</span><span style="color: rgba(0, 0, 255, 1)">include</span>('./conn/conn.php'<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(128, 0, 128, 1)">$sql</span>="select * from student"<span style="color: rgba(0, 0, 0, 1)">;
</span><span style="color: rgba(128, 0, 128, 1)">$result</span> = sqlsrv_query( <span style="color: rgba(128, 0, 128, 1)">$conn</span>, <span style="color: rgba(128, 0, 128, 1)">$sql</span> ) or <span style="color: rgba(0, 0, 255, 1)">die</span>("数据查询失败!"<span style="color: rgba(0, 0, 0, 1)">);

</span><span style="color: rgba(0, 0, 255, 1)">if</span>(!<span style="color: rgba(0, 0, 255, 1)">empty</span>(<span style="color: rgba(128, 0, 128, 1)">$_GET</span><span style="color: rgba(0, 0, 0, 1)">)){
    </span><span style="color: rgba(128, 0, 128, 1)">$delete</span>=<span style="color: rgba(128, 0, 128, 1)">$_GET</span>['delete'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(0, 0, 255, 1)">if</span>(<span style="color: rgba(128, 0, 128, 1)">$delete</span>='1'<span style="color: rgba(0, 0, 0, 1)">){
      </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "&lt;script&gt;alert('删除成功!');&lt;/script&gt;"<span style="color: rgba(0, 0, 0, 1)">;

    }</span><span style="color: rgba(0, 0, 255, 1)">else</span><span style="color: rgba(0, 0, 0, 1)">{
      </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "&lt;script&gt;alert('删除失败!');&lt;/script&gt;"<span style="color: rgba(0, 0, 0, 1)">;
    }

}
</span><span style="color: rgba(0, 0, 255, 1)">function</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('GBK', 'UTF-8', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}

</span>?&gt;

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;学生管理系统&lt;/title&gt;
    &lt;link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" /&gt;
    &lt;script src="js/jquery-1.11.3.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="js/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;style type="text/css"&gt;
      <span style="color: rgba(0, 128, 0, 1)">/*</span><span style="color: rgba(0, 128, 0, 1)">body {
                background-repeat: no-repeat;
                background-size:cover;
                background-attachment: fixed;
                background-image: url(image/c_b2.jpg);
                background-position: 0px -80px;
            }</span><span style="color: rgba(0, 128, 0, 1)">*/</span><span style="color: rgba(0, 0, 0, 1)">
      table {
            margin</span>:<span style="color: rgba(0, 0, 0, 1)"> auto;
            width</span>: 80%<span style="color: rgba(0, 0, 0, 1)">;
            text</span>-align:<span style="color: rgba(0, 0, 0, 1)"> center;
            background</span>-color: <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">ffffff;</span>
<span style="color: rgba(0, 0, 0, 1)">      }

      h1 {
            font</span>-family:<span style="color: rgba(0, 0, 0, 1)"> 华文行楷;
      }
    </span>&lt;/style&gt;
    &lt;script type="text/javascript"&gt;
      <span style="color: rgba(0, 0, 255, 1)">function</span><span style="color: rgba(0, 0, 0, 1)"> deleteStudent(sno) {
            </span><span style="color: rgba(0, 0, 255, 1)">if</span> (confirm("您是否要删除该项?"<span style="color: rgba(0, 0, 0, 1)">)) {
                location</span>.href = "delete.php?sno="+<span style="color: rgba(0, 0, 0, 1)">sno;
            }
      }
    </span>&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
    &lt;h1 align="center"&gt;学生信息管理系统&lt;/h1&gt;
    &lt;h3 align="center"&gt;
      &lt;a href="add.php"&gt;添加学生信息&lt;/a&gt;
    &lt;/h3&gt;
&lt;/div&gt;
&lt;div style="align-content: center;"&gt;
    &lt;table <span style="color: rgba(0, 0, 255, 1)">class</span>="table table-bordered" style="width: 80%;"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
            &lt;th&gt;&lt;p align="center"&gt;学号&lt;/p&gt;&lt;/th&gt;
            &lt;th&gt;&lt;p align="center"&gt;姓名&lt;/p&gt;&lt;/th&gt;
            &lt;th&gt;&lt;p align="center"&gt;性别&lt;/p&gt;&lt;/th&gt;
            &lt;th&gt;&lt;p align="center"&gt;年龄&lt;/p&gt;&lt;/th&gt;
            &lt;th&gt;&lt;p align="center"&gt;学院&lt;/p&gt;&lt;/th&gt;
            &lt;th colspan="2"&gt;&lt;p align="center"&gt;操作&lt;/p&gt;&lt;/th&gt;

      &lt;/tr&gt;

      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;?<span style="color: rgba(0, 0, 0, 1)">php
      </span><span style="color: rgba(0, 0, 255, 1)">while</span>(<span style="color: rgba(128, 0, 128, 1)">$row</span> = sqlsrv_fetch_array( <span style="color: rgba(128, 0, 128, 1)">$result</span>,<span style="color: rgba(0, 0, 0, 1)"> SQLSRV_FETCH_ASSOC)){
            </span>?&gt;
            &lt;tr&gt;
                &lt;td&gt;&lt;?php <span style="color: rgba(0, 0, 255, 1)">echo</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sno']);?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php <span style="color: rgba(0, 0, 255, 1)">echo</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sname']);?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php <span style="color: rgba(0, 0, 255, 1)">echo</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Ssex']);?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php <span style="color: rgba(0, 0, 255, 1)">echo</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sage']);?&gt;&lt;/td&gt;
                &lt;td&gt;&lt;?php <span style="color: rgba(0, 0, 255, 1)">echo</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sdept']);?&gt;&lt;/td&gt;

                &lt;td&gt;&lt;<span style="color: rgba(0, 0, 0, 1)">a
                        href</span>="update.php?sno=&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sno']);?&gt;"&gt;修改&lt;/a&gt;&lt;/td&gt;
                &lt;td&gt;&lt;a href="javascript:;" onclick="deleteStudent(&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sno']);?&gt;)"&gt;删除&lt;/a&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;?<span style="color: rgba(0, 0, 0, 1)">php
      }
      </span>?&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;hr&gt;
    &lt;h1 align="center" style="font-size: 20px;"&gt;石家庄铁道大学 @2018-2020&lt;/h1&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<p><span style="font-family: 宋体; font-size: 16px">  2、add.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_ceb6e6c9-9986-4655-b0a8-88ba35dc799f" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_ceb6e6c9-9986-4655-b0a8-88ba35dc799f" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_ceb6e6c9-9986-4655-b0a8-88ba35dc799f" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php
</span><span style="color: rgba(0, 0, 255, 1)">include</span>('./conn/conn.php'<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(0, 0, 255, 1)">function</span> toGBK(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('UTF-8', 'GBK', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}
</span><span style="color: rgba(0, 0, 255, 1)">if</span>(!<span style="color: rgba(0, 0, 255, 1)">empty</span>(<span style="color: rgba(128, 0, 128, 1)">$_POST</span><span style="color: rgba(0, 0, 0, 1)">)){
    </span><span style="color: rgba(128, 0, 128, 1)">$name</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['name'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sex</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['sex'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['sno'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$dept</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['dept'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$age</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['age'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sno</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$name</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$name</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sex</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sex</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$dept</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$dept</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sql</span> = "insert into Student(Sno,Sname,Ssex,Sage,Sdept) values('<span style="color: rgba(128, 0, 128, 1)">$sno</span>','<span style="color: rgba(128, 0, 128, 1)">$name</span>','<span style="color: rgba(128, 0, 128, 1)">$sex</span>',<span style="color: rgba(128, 0, 128, 1)">$age</span>,'<span style="color: rgba(128, 0, 128, 1)">$dept</span>')"<span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 128, 1)">$sql</span><span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(128, 0, 128, 1)">$result</span> = sqlsrv_query(<span style="color: rgba(128, 0, 128, 1)">$conn</span>, <span style="color: rgba(128, 0, 128, 1)">$sql</span>) or <span style="color: rgba(0, 0, 255, 1)">die</span>("数据插入失败!"<span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(0, 128, 128, 1)">header</span>("location:index.php"<span style="color: rgba(0, 0, 0, 1)">);
}

</span>?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;添加学生信息&lt;/title&gt;
    &lt;style type="text/css"&gt;<span style="color: rgba(0, 0, 0, 1)">
      html {
            font</span>-size:<span style="color: rgba(0, 0, 0, 1)"> 15px;
      }

      fieldset {
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 450px;
            margin</span>: 0<span style="color: rgba(0, 0, 0, 1)"> auto;
      }

      legend {
            font</span>-weight:<span style="color: rgba(0, 0, 0, 1)"> bold;
            font</span>-size:<span style="color: rgba(0, 0, 0, 1)"> 18px;
      }

      label {
            </span><span style="color: rgba(0, 0, 255, 1)">float</span>:<span style="color: rgba(0, 0, 0, 1)"> left;
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 70px;
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 10px;
      }

      </span>.<span style="color: rgba(0, 0, 0, 1)">left {
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 80px;
      }

      </span>.<span style="color: rgba(0, 0, 0, 1)">input {
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 200px;
            border</span>: 1px solid <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">ccc;</span>
            padding:<span style="color: rgba(0, 0, 0, 1)"> 7px 0px;
            border</span>-radius: 3px; <span style="color: rgba(0, 128, 0, 1)">/*</span><span style="color: rgba(0, 128, 0, 1)">css3属性IE不支持</span><span style="color: rgba(0, 128, 0, 1)">*/</span><span style="color: rgba(0, 0, 0, 1)">
            padding</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 5px;
      }

      span {
            color</span>: <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">666666;</span>
<span style="color: rgba(0, 0, 0, 1)">      }
      p{
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 30px;

      }
    </span>&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;fieldset&gt;
    &lt;legend&gt;添加个人信息&lt;/legend&gt;
    &lt;form name="addForm" method="post" action="#"&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="sno" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;学号:&lt;/label&gt;
            &lt;input id="sno" name="sno" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" /&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="name" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;姓名:&lt;/label&gt;
            &lt;input id="name" name="name" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" /&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="sex" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;性别:&lt;/label&gt;
            &lt;input name="sex" type="radio" value="男" &gt;<span style="color: rgba(0, 0, 0, 1)">男
            </span>&lt;input name="sex" type="radio"value="女"&gt;<span style="color: rgba(0, 0, 0, 1)">女
      </span>&lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="age" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;年龄:&lt;/label&gt;
            &lt;input id="age" name="age" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" /&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="dept" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;学院:&lt;/label&gt;
            &lt;input id="dept" name="dept" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" /&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;input type="reset" value=" 重 置 "/&gt;
            &lt;input type="submit" name="submit" value="提交" <span style="color: rgba(0, 0, 255, 1)">class</span>="left" /&gt;
      &lt;/p&gt;
    &lt;/form&gt;
&lt;/fieldset&gt;
&lt;/body&gt;
&lt;/html&gt;</span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<p><span style="font-family: 宋体; font-size: 16px">  3、undate.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_d6821280-c4a0-4040-a661-d76bc4cfcff4" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_d6821280-c4a0-4040-a661-d76bc4cfcff4" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_d6821280-c4a0-4040-a661-d76bc4cfcff4" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php

</span><span style="color: rgba(0, 0, 255, 1)">include</span>('./conn/conn.php'<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(0, 0, 255, 1)">function</span> toU8(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('GBK', 'UTF-8', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}

</span><span style="color: rgba(0, 0, 255, 1)">function</span> toGBK(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('UTF-8', 'GBK', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}

</span><span style="color: rgba(0, 0, 255, 1)">if</span>(!<span style="color: rgba(0, 0, 255, 1)">empty</span>(<span style="color: rgba(128, 0, 128, 1)">$_GET</span><span style="color: rgba(0, 0, 0, 1)">) ){
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=<span style="color: rgba(128, 0, 128, 1)">$_GET</span>['sno'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sno</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sql</span>="select * from student where Sno='<span style="color: rgba(128, 0, 128, 1)">$sno</span>'"<span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(128, 0, 128, 1)">$result</span> = sqlsrv_query(<span style="color: rgba(128, 0, 128, 1)">$conn</span>, <span style="color: rgba(128, 0, 128, 1)">$sql</span>) or <span style="color: rgba(0, 0, 255, 1)">die</span>("数据查询失败!"<span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$row</span>=sqlsrv_fetch_array( <span style="color: rgba(128, 0, 128, 1)">$result</span>,<span style="color: rgba(0, 0, 0, 1)"> SQLSRV_FETCH_ASSOC);
}
</span>?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;修改学生信息&lt;/title&gt;
    &lt;style type="text/css"&gt;<span style="color: rgba(0, 0, 0, 1)">
      html {
            font</span>-size:<span style="color: rgba(0, 0, 0, 1)"> 15px;
      }

      fieldset {
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 450px;
            margin</span>: 0<span style="color: rgba(0, 0, 0, 1)"> auto;
      }

      legend {
            font</span>-weight:<span style="color: rgba(0, 0, 0, 1)"> bold;
            font</span>-size:<span style="color: rgba(0, 0, 0, 1)"> 18px;
      }

      label {
            </span><span style="color: rgba(0, 0, 255, 1)">float</span>:<span style="color: rgba(0, 0, 0, 1)"> left;
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 70px;
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 10px;
      }

      </span>.<span style="color: rgba(0, 0, 0, 1)">left {
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 80px;
      }

      </span>.<span style="color: rgba(0, 0, 0, 1)">input {
            width</span>:<span style="color: rgba(0, 0, 0, 1)"> 200px;
            border</span>: 1px solid <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">ccc;</span>
            padding:<span style="color: rgba(0, 0, 0, 1)"> 7px 0px;
            border</span>-radius: 3px; <span style="color: rgba(0, 128, 0, 1)">/*</span><span style="color: rgba(0, 128, 0, 1)">css3属性IE不支持</span><span style="color: rgba(0, 128, 0, 1)">*/</span><span style="color: rgba(0, 0, 0, 1)">
            padding</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 5px;
      }

      span {
            color</span>: <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">666666;</span>
<span style="color: rgba(0, 0, 0, 1)">      }
      p{
            margin</span>-left:<span style="color: rgba(0, 0, 0, 1)"> 30px;

      }
    </span>&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;fieldset&gt;
    &lt;legend&gt;修改学生信息&lt;/legend&gt;
    &lt;form name="addForm" method="post" action="change.php"&gt;

      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="sno" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;学号:&lt;/label&gt;
            &lt;input id="sno" name="sno" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" value="&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sno']); ?&gt;"/&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="name" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;真实姓名:&lt;/label&gt;
            &lt;input id="name" name="name" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" value="&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sname']); ?&gt;"/&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="sex" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;性别:&lt;/label&gt;
            &lt;input name="sex" type="radio" value="男"
                &lt;?<span style="color: rgba(0, 0, 0, 1)">php
                </span><span style="color: rgba(0, 0, 255, 1)">if</span>(toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Ssex'])=='男'<span style="color: rgba(0, 0, 0, 1)">){
                  </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "checked='checked'"<span style="color: rgba(0, 0, 0, 1)">;
                }

                </span>?&gt;
            &gt;<span style="color: rgba(0, 0, 0, 1)">男
            </span>&lt;input name="sex" type="radio" value="女"
                &lt;?<span style="color: rgba(0, 0, 0, 1)">php
                </span><span style="color: rgba(0, 0, 255, 1)">if</span>(toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Ssex'])=='女'<span style="color: rgba(0, 0, 0, 1)">){
                  </span><span style="color: rgba(0, 0, 255, 1)">echo</span> "checked='checked'"<span style="color: rgba(0, 0, 0, 1)">;
                }

                </span>?&gt;
            &gt;<span style="color: rgba(0, 0, 0, 1)">女
      </span>&lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="age" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;年龄:&lt;/label&gt;
            &lt;input id="age" name="age" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" value="&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sage']); ?&gt;"/&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;label <span style="color: rgba(0, 0, 255, 1)">for</span>="dept" <span style="color: rgba(0, 0, 255, 1)">class</span>="label"&gt;学院:&lt;/label&gt;
            &lt;input id="dept" name="dept" type="text" <span style="color: rgba(0, 0, 255, 1)">class</span>="input" value="&lt;?php echo toU8(<span style="color: rgba(128, 0, 128, 1)">$row</span>['Sdept']); ?&gt;"/&gt;
      &lt;p/&gt;
      &lt;p&gt;
            &lt;input type="reset" value="重置"/&gt;
            &lt;input type="submit" name="submit" value="确 定" <span style="color: rgba(0, 0, 255, 1)">class</span>="left" /&gt;
      &lt;/p&gt;
    &lt;/form&gt;
&lt;/fieldset&gt;
&lt;/body&gt;
&lt;/html&gt;</span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<p><span style="font-family: 宋体; font-size: 16px">  4、change.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_d72bd3d1-7c93-4400-8c01-3564b624bf09" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_d72bd3d1-7c93-4400-8c01-3564b624bf09" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_d72bd3d1-7c93-4400-8c01-3564b624bf09" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php
</span><span style="color: rgba(0, 0, 255, 1)">include</span>('./conn/conn.php'<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(0, 0, 255, 1)">function</span> toGBK(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('UTF-8', 'GBK', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}
</span><span style="color: rgba(0, 0, 255, 1)">if</span>(!<span style="color: rgba(0, 0, 255, 1)">empty</span>(<span style="color: rgba(128, 0, 128, 1)">$_POST</span><span style="color: rgba(0, 0, 0, 1)">)){
    </span><span style="color: rgba(128, 0, 128, 1)">$name</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['name'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sex</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['sex'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['sno'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$dept</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['dept'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$age</span>=<span style="color: rgba(128, 0, 128, 1)">$_POST</span>['age'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sno</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$name</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$name</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sex</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sex</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$dept</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$dept</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sql</span> = "updateStudent set Sno ='<span style="color: rgba(128, 0, 128, 1)">$sno</span>', Sname='<span style="color: rgba(128, 0, 128, 1)">$name</span>', Ssex='<span style="color: rgba(128, 0, 128, 1)">$sex</span>',Sage=<span style="color: rgba(128, 0, 128, 1)">$age</span>, Sdept='<span style="color: rgba(128, 0, 128, 1)">$dept</span>' where Sno ='<span style="color: rgba(128, 0, 128, 1)">$sno</span>'"<span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 128, 1)">$sql</span><span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(128, 0, 128, 1)">$result</span> = sqlsrv_query(<span style="color: rgba(128, 0, 128, 1)">$conn</span>, <span style="color: rgba(128, 0, 128, 1)">$sql</span>) or <span style="color: rgba(0, 0, 255, 1)">die</span>("数据更新失败!"<span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(0, 128, 128, 1)">header</span>("location:index.php"<span style="color: rgba(0, 0, 0, 1)">);
}</span></span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<p><span style="font-family: 宋体; font-size: 16px">  5、delete.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_0b1395a8-3553-410d-8b6e-04e406e4a5a2" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_0b1395a8-3553-410d-8b6e-04e406e4a5a2" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_0b1395a8-3553-410d-8b6e-04e406e4a5a2" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php
</span><span style="color: rgba(0, 0, 255, 1)">include</span>('./conn/conn.php'<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(0, 0, 255, 1)">function</span> toGBK(<span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">){
    </span><span style="color: rgba(0, 0, 255, 1)">return</span> <span style="color: rgba(0, 128, 128, 1)">iconv</span>('UTF-8', 'GBK', <span style="color: rgba(128, 0, 128, 1)">$str</span><span style="color: rgba(0, 0, 0, 1)">);
}
</span><span style="color: rgba(0, 0, 255, 1)">if</span>(!<span style="color: rgba(0, 0, 255, 1)">empty</span>(<span style="color: rgba(128, 0, 128, 1)">$_GET</span><span style="color: rgba(0, 0, 0, 1)">)){
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=<span style="color: rgba(128, 0, 128, 1)">$_GET</span>['sno'<span style="color: rgba(0, 0, 0, 1)">];
    </span><span style="color: rgba(128, 0, 128, 1)">$sno</span>=toGBK(<span style="color: rgba(128, 0, 128, 1)">$sno</span><span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(128, 0, 128, 1)">$sql_d</span>="delete from student where Sno='<span style="color: rgba(128, 0, 128, 1)">$sno</span>'"<span style="color: rgba(0, 0, 0, 1)">;
    </span><span style="color: rgba(128, 0, 128, 1)">$result_d</span> = sqlsrv_query(<span style="color: rgba(128, 0, 128, 1)">$conn</span>, <span style="color: rgba(128, 0, 128, 1)">$sql_d</span>) or <span style="color: rgba(0, 0, 255, 1)">die</span>("数据查询失败!"<span style="color: rgba(0, 0, 0, 1)">);
    </span><span style="color: rgba(0, 0, 255, 1)">if</span>(<span style="color: rgba(128, 0, 128, 1)">$result_d</span><span style="color: rgba(0, 0, 0, 1)">){
      </span><span style="color: rgba(0, 128, 128, 1)">header</span>("location:index.php?delete=1"<span style="color: rgba(0, 0, 0, 1)">);
    }</span><span style="color: rgba(0, 0, 255, 1)">else</span><span style="color: rgba(0, 0, 0, 1)">{
      </span><span style="color: rgba(0, 128, 128, 1)">header</span>("location:index.php?delete=0"<span style="color: rgba(0, 0, 0, 1)">);
    }
}</span></span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<p><span style="font-family: 宋体; font-size: 16px">  6、conn.php</span></p>
<div class="cnblogs_code"><span style="font-family: 宋体; font-size: 16px"><img id="code_img_closed_a58ba1a3-9949-4a0a-823f-60b5b9b04569" class="code_img_closed" src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt=""><img id="code_img_opened_a58ba1a3-9949-4a0a-823f-60b5b9b04569" class="code_img_opened" style="display: none" src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt=""></span>
<div id="cnblogs_code_open_a58ba1a3-9949-4a0a-823f-60b5b9b04569" class="cnblogs_code_hide">
<pre><span style="font-family: 宋体; font-size: 16px">&lt;?<span style="color: rgba(0, 0, 0, 1)">php
</span><span style="color: rgba(0, 128, 128, 1)">header</span>("content-Type: text/html; charset=utf-8"<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(128, 0, 128, 1)">$serverName</span> = "localhost"; <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库服务器地址</span>
<span style="color: rgba(128, 0, 128, 1)">$uid</span> = "sa";   <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库用户名</span>
<span style="color: rgba(128, 0, 128, 1)">$pwd</span> = "lxy208751"; <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">数据库密码</span>
<span style="color: rgba(128, 0, 128, 1)">$connectionInfo</span> = <span style="color: rgba(0, 0, 255, 1)">array</span>("UID" =&gt; <span style="color: rgba(128, 0, 128, 1)">$uid</span>, "PWD" =&gt; <span style="color: rgba(128, 0, 128, 1)">$pwd</span>, "Database" =&gt; "Students"<span style="color: rgba(0, 0, 0, 1)">);
</span><span style="color: rgba(128, 0, 128, 1)">$conn</span> = sqlsrv_connect(<span style="color: rgba(128, 0, 128, 1)">$serverName</span>, <span style="color: rgba(128, 0, 128, 1)">$connectionInfo</span>);</span></pre>
</div>
<span class="cnblogs_code_collapse" style="font-family: 宋体; font-size: 16px">View Code</span></div>
<h2><strong><span style="font-family: 黑体; font-size: 14pt">四、视图</span></strong></h2>
<p><span style="font-family: 宋体; font-size: 16px"><img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183116750-1684257889.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;<img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183129512-409527910.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;<img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183147315-151403160.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;<img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183203124-10163561.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;<img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183224793-1656799154.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;<img src="https://img2020.cnblogs.com/blog/1543695/202005/1543695-20200528183236239-372491359.png" alt=""></span></p>
<p><span style="font-family: 宋体; font-size: 16px">&nbsp;</span></p><br><br>
来源:https://www.cnblogs.com/20183544-wangzhengshuai/p/12982811.html
頁: [1]
查看完整版本: php连接SqlServer并实现增删改查