我需要选择具有特定变量的数据库... 像这样:
$key = $_GET["key"];
$database = $_GET["category"];
$q = "SELECT * FROM '$database' WHERE universal_key = '$key'";
$r = mysqli_query($dbc, $q);
但我遇到了这个问题:mysqli_num_rows()希望参数1为mysqli_result,给定布尔值
当我尝试没有这样的变量时:
$key = $_GET["key"];
$database = $_GET["category"];
$q = "SELECT * FROM db_name WHERE universal_key = '$key'";
$r = mysqli_query($dbc, $q); `
它有效!!变量$ database与db_name(db_name = $ database)...
相同