Mysql数据库内加入查询给错误
问题描述:
SQL数据库三表使用内部联接,但它给予错误。图片中显示的错误。我不知道问题是什么。Mysql数据库内加入查询给错误
Regserver.php
<?php
include 'Connection.php';
$reg = $_GET['reg'];
$sql = "select RegNo,a.RollNo,b.Standard,b.stdid,c.DivisionID,c.Division,Std_Name as StudentName,Std_Address,DOB,ContactNo1 as FatherNo,ContactNo2 as MotherNo,
School_Name as SchoolName,Decide_Fees as DecideFees,ImagePath
from Std_Reg as a inner join StandardMaster as b on a.Standard = b.stdid
inner join DivisionMaster as c on a.Division =c.DivisionID
where RegNo= '$reg'";
//$sql = "select * from Std_Reg";
$stmt = sqlsrv_query($conn, $sql);
do {
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){
$result[] = $row;
}
} while (sqlsrv_next_result($stmt));
if(count($result)>0)
{
$result1['status']=1;//"Login successfully";
array_push($result,$result1);
}
else
{
//$result[]="null";
$result1['status']=0;//"Record not found";
array_push($result,$result1);
}
sqlsrv_free_stmt($stmt);
sqlsrv_close($conn); //Close the connnectiokn first
echo json_encode($result); //You will get the encoded array variable
?>
U可以发布错误消息的文本? – tan
注意:未定义变量:结果在C:\瓦帕\ WWW \项目\ Regserver.php上线21 – Zala
说明:未定义变量:结果在C:\瓦帕\ WWW \项目\ Regserver.php上线21 – Zala