I have searched the internet about this and found hundreds have asked the question and not once was it answered in a meaningful way--or maybe I'm just dense.
Would somebody please tell me what is the problem here:
Simple, simple form:
<html>
<body>
<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>
</body>
</html>
===========
Simple, simple PHP script:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'xyz';
$dbname = 'ABC';
$conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname);
if($conn)
echo 'Connected successfully. <br> Here are the results of your query:<br><br>';
$A=$_POST["A"];
$B=$_POST["B"];
$sql = 'SELECT * FROM numbers WHERE A = $A AND B = $B';
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result)) {
echo $row["0"] . ", ";
}
} else {
echo "0 results";
}
mysqli_close($conn);
?>
Which is 'parameter 1'? and which is the 'bool given'?
But most importantly, how should it be written so that it returns the desired results? I have checked the query from the CMD line, it returns multiple entries.
Really, I have reached FRUSTRATION OVERLOAD!