I am a novice, wrote a query MySQL database PHP, the post method to pass parameters but no output, why?
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 ();? >
Reply to discussion (solution)
11 lines num_rows?
16 Rows $i < p="">
New Mysqli, the host name, user name, password, and database name, are XXXX??
11 lines num_rows?
16 Rows $i < p="">
Clerical error, line 16 is $i < $num
New Mysqli, the host name, user name, password, and database name, are XXXX??
Of course not, I'm not good to give you the account and password to call out
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 ();? >
Strange, there is no add $ in front of the variable name, your page does not have an error?
for ($i = 0; $i < $num; $i + +) {
$row = $result->fetch_assoc ();
echo $row [' price ']. ' '. $row [' area '];
}
Strange, there is no add $ in front of the variable name, your page does not have an error?
for ($i = 0; $i < $num; $i + +) {
$row = $result->fetch_assoc ();
echo $row [' price ']. ' '. $row [' area '];
}
No error, a blank. Thank you moderator, too careless!
As you can see from your code, each branch will have output.
If it is a blank, it means that you test the code fatal error, and do not open PHP error display function (oneself to make trouble for oneself)
You can also first put $community = $_post["Community"; print it out and see.