欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

数据传递的问题
inquire.html


inquire the classroom



CRMS - Inquire the classroom











Classroom ID






inquire_classroom.php


inquire the classroom


CRMS - Inquire the classroom


// create short variable names
$lesson_id=$_POST['lesson_id'];

$con = mysql_connect("localhost","root","");
//通过服务器locahost建立连接,用户名为root,无密码

if (!$con)
{
die('Could not connect: ' . mysql_error());
}//如果不成功,显示错误
mysql_select_db("crms", $con);//选择数据库

if (!mysql_select_db("crms", $con)) die(mysql_error());

$search_lesson_id = "SELECT * FROM use2 WHERE lesson_id = '{$lesson_id}'";
$result = mysql_query($search_lesson_id,$con);
if (!$result)
{
die("The lesson does not exist.");
}

while($row = mysql_fetch_array($result))
{
echo $row['Cno'];
echo $row['CID'];
echo "
";
}

mysql_close($con);
?>


下拉框选择了一个值提交后,出现
Notice: Undefined index: lesson_id in D:\xampp\htdocs\inquire_classroom.php on line 9
D301001 的错误。但是这里
相关标签: quot option lt gt value

上一篇: Mac OS下配置PHP+MySql环境_PHP

下一篇: 随机变量函数的分布: PHP常用函数之is_var():检测是否合法变量名

推荐阅读