MYSQL中给出的错误布尔值

Plz Help i Dont know what is wrong in this function ....

$gsql = "SELECT * FROM posts WHERE group='$group_name' ORDER BY postdate DESC LIMIT 0,20";
$gquery = mysqli_query($db_conx, $gsql);
$gstatusnumrows = mysqli_num_rows($gquery);

while ($grow = mysqli_fetch_array($gquery, MYSQLI_ASSOC)) {

and it keeps saying this error :-

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\group.php on line 3

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\group.php on line 5

That means your query failed.

[mysqli_query] returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE.

So use mysqli_error to find out what you did wrong. In this case, though, it's because you have a column named "group". GROUP is a reserved word in MySQL. To be on the safe side, ALL database, table and column names SHOULD be enclosed in backticks ` to prevent any possible ambiguity.