Home > Backend Development > PHP Tutorial > php查询数据库表有关问题

php查询数据库表有关问题

WBOY
Release: 2016-06-13 12:44:59
Original
741 people have browsed it

php查询数据库表问题

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br>
<br>
<br>
<meta><br>
<title>学生课题查询</title><br>
<style><br />
<!--<br />
.STYLE1 {font-size: 14px}<br />
--><br />
</style><br>
<br>
<br>
<br>
<?php <br />
//######################学生查询所选课题##########################<br>
 include "config.php";<br>
 include "header.php";?><br>
 <br>
if($search)<br>
{<br>
  if ($xuehao=="") <br>
 {<br>
	echo"<p><font><b><big>请填写您的学号!</big></b></font></p>";<br>
	echo "<meta>";<br>
	exit;	<br>
 }  <br>
 <br>
 $query="select * from $student_table where xuehao='$xuehao'";<br>
 mysql_query("set names 'gb2312'");<br>
 $result=mysql_query($query);<br>
 $row=mysql_fetch_array($result);<br>
 if($row==0)<br>
 {<br>
	echo"<p><font><b><big>你还没有注册,或者你的输入有误,请重新输入!</big></b></font></p>";<br>
	echo "<meta>";<br>
    exit;<br>
 }<br>
 <br>
 $query="select id as sm from $student_table where xuehao='$xuehao'";<br>
 mysql_query("set names 'gb2312'");<br>
 $result=mysql_query($query);<br>
 $row=mysql_fetch_array($result);<br>
 if($row[sm]==0)<br>
 {<br>
	echo"<p><font><b><big>你还没有选择课题,请去选题!</big></b></font></p>";<br>
	echo "<meta>";<br>
    exit;<br>
 }<br>
 ?><br>
Copy after login

   
  
    
    
    
    
   
   
  $n=0; 
   $query=mysql_query("select * from $jiaoshi_table,$student_table where $jiaoshi_table.id=$student_table.id and $student_table.xuehao='$xuehao'");
 
      
 
        

学生学号


      

    
 
      
学生姓名

    
 
    
 课题名称 
    
 
      
指导教师

    
 
    
职称
    
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template