标签:数据 data- 文件 接收 uri htm 语句 sid mod
<html> <body> <h1> Welcome <?php echo $_GET["lastname"]; ?> </h1> <br> </body> </html>
mysql -uroot -proot show databases; use websecurity; create table Studen(StudentID int primary key auto_increment,Name varchar(100),Profile varchar(1000)); describe Student; insert into Student values(1,"Lily","I am Lily"); insert into Student values(2,"Lucy","I am Lucy"); insert into Student values(3,"Tom","I am Tom"); select * from Student; select * from Student where StudentID=1;
<?php $mysql = mysqli_connect("localhost","root","root","websecurity"); //数据库所在服务器IP,数据库名字,用户名,用户密码 $sid = $_GET[‘id‘]; $query = "select Name,Profile from Student where StudentID=$sid"; $rs = $mysql->query($query); while($result = mysqli_fetch_array($rs)) printf($result["Name"],$result["Profile"]); ?>
标签:数据 data- 文件 接收 uri htm 语句 sid mod
原文地址:https://www.cnblogs.com/tianjiazhen/p/12235582.html