<form action="send_post.php" method="post">
<p>A: <input type="text" name="A">
<p>B: <input type="text" name="B">
<p><input type="submit">
</form>
<?php
$db = "localhost"; $usr = "blah1"; $pword = "blah2"; $dbname = "blah3";
-----connects to server ok -------
$A = mysqli_real_escape_string($conn, $_POST['A']);
$B = mysqli_real_escape_string($conn, $_POST['B']);
$query="SELECT * FROM blah4 where A=$A and B=$B";
$sql=mysqli_query($conn, $query);
echo $sql;
$conn->clos();
?>
需要什麼來顯示數據從數據庫?無法獲得查詢結果顯示 - php/mysqli
您需要顯示所有代碼。這對我們無能爲力。 – Matt
你應該[準備](http://php.net/manual/en/mysqli.prepare.php)SQL層。比'mysqli_real_escape_string'更安全! –