$dbname="dorm"
mysql_connect('localhost','root','root')
$sql = 'SELECT No,Name FROM `member` '
mysql_query("SET NAMES GBK")
$result=mysql_db_query($dbname,$sql)
while($row=mysql_fetch_array($result))
{
echo "<a href=\"MemberDetail.php?id=" . $row["No"] . "\">" . $row["Name"] . "</a>"
}
mysql_free_result($result)
mysql_close()
?>
MemberDetail.php
<?php
$no = $_GET['id']
$dbname="dorm"
mysql_connect('localhost','root','root')
$sql = "SELECT Detail FROM `member` WHERE No = '$no'"
mysql_query("SET NAMES GBK")
$result=mysql_db_query($dbname,$sql)
while($row=mysql_fetch_array($result))
{
echo "$row['Detail']"
}
mysql_free_result($result)
mysql_close()
?>
1、SELECT s.name,c.cname FROM student AS s,course AS c,student_course AS r WHERE s.sno = r.sno AND c.cno = r.cno写入JSON用json_encode()
2、SELECT s.name,c.cname FROM student AS s,course AS c,student_course AS r WHERE s.sno = r.sno AND c.cno = r.cno AND s.sid = 's002'
DELETE FROM student_course WHERE sno = 's002' LIMIT 1
3、INSERT INTO student_course(sno,cno) VALUES('s001','c002'),('s001','c003')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)