时间:2021-07-01 10:21:17 帮助过:8人阅读
$community = $_POST["community"];
$db = new mysqli('xxxxx','xxxx','xxxx','xxxx');
if(mysqli_connect_errno()) {
echo '数据库连接失败!';
$db->close();
exit;
}
$query = "select * from sell where community = '".$community."'";
$result = $db->query($query);
$num = $result->num_rows;
if($num == 0) {
echo 'ERROR_NORESULT';
}
else {
for($i = 0; $i < num; $i++) {
$row = $result->fetch_assoc();
echo row['price'].' '.['area'];
}
}
$result->free();
$db->close();
?>
ini_set('display_errors','on');
error_reporting(E_ALL);
$community = $_POST["community"];
$db = new mysqli('xxxxx','xxxx','xxxx','xxxx');
if(mysqli_connect_errno()) {
echo '数据库连接失败!';
$db->close();
exit;
}
$query = "select * from sell where community = '".$community."'";
$result = $db->query($query);
$num = $result->num_rows;
if($num == 0) {
echo 'ERROR_NORESULT';
}
else {
for($i = 0; $i < $num; $i++) {
$row = $result->fetch_assoc();
echo row['price'].' '.['area'];
}
}
$result->free();
$db->close();
?>