我正在构建一个api来编码android中的数据。在android studio下面的声明出现了。
警告:mysqli_stmt_bind_param():变量数量与 C:\ xampp \ htdocs \ androidapi \ Search_By_Name.php 在线 6
{"成功":true," Institute_Name":"旁遮普公立高中"," Institute_Code":54000}
它正在获取数据但未在Android应用中显示 以下是Webapi PHP的代码
<?php
include 'dbconnect.php';
if(isset($_POST['Institute_Name'])){
$name = $_POST['Institute_Name'];
$statement = mysqli_prepare($con, "SELECT * FROM institute WHERE Institute_Name = ? " );
mysqli_stmt_bind_param($statement,"s", $name);
mysqli_stmt_execute($statement);
//mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement,$Institute_Code, $Institute_Name,$Institute_Type,$Contact_Info ,$Religion ,$Existance ,$Facility ,$Admission_Info ,$Branches ,$About_Institute ,$Scolarship_Programs,$Facility_Info ,$Institute_For ,$Institute_Sector ,$Address ,$radio ,$Degree_Description,$City_ID, $is_approved, $User_ID);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
$response["Institute_Name"] = $Institute_Name;
$response["Institute_Code"] = $Institute_Code;
$response["Institute_Type"] = $Institute_Type;
$response["Contact_Info"] = $Contact_Info;
echo json_encode($response);
} }
else {
echo "Name not set";
} ?>