ITPub博客

首页 > 应用开发 > > session如何获取当前id

session如何获取当前id

作者:stzgq 时间:2019-10-29 15:51:34 0 删除 编辑

我想做一个教师打分系统,想用session获取要打分的教师的coursesid,session语句应该怎么写,写在哪里???怎么写都不对,求大神指教,必有重谢!!!!!!

<?php session_start(); ?>

<?php

include("conn.php");

mysql_select_db("selectcourses");

$sql="select *from newselectcourse";

$result=mysql_query($sql);

?>

<html>

<head>

<title>

</title>

</head>

<body>

<table border=1>

<tr>

<td>课程号</td>

<td>课程名</td>

<td>任课教师</td>

<td>评分</td>

</tr>

<?php

if($result){

while($row=mysql_fetch_assoc($result)){

?>

<tr>

<td><?php echo $row['coursesid']?></td>

<td><?php echo $row['courses']?></td>

<td><?php echo $row['teachername']?></td>

<td><a href="2.php?coursesid=<?php echo $row['coursesid']?>">打分

</a></td>

</tr>

<?php

}

}

?>

</table>

</body>

</html>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2478/viewspace-3143928/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: i
请登录后发表评论 登录
全部评论

注册时间:2019-08-05

  • 博文量
    104
  • 访问量
    1052