我有什么:
$table_name_arcticles = 'arcticles';
$arcticles_count = mysqli_query($connection, "SELECT * FROM `articles` WHERE `categories_id` =" . $data['id']);
我需要什么,像这样:
$table_name_arcticles = 'arcticles';
$arcticles_count = mysqli_query($connection, "SELECT * FROM $table_name_arcticles WHERE `categories_id` =" . $data['id']);
答案 0 :(得分:0)
使用此...
$table_name_arcticles = 'arcticles';
$query="SELECT * FROM ".$table_name_arcticles." WHERE `categories_id` =" . $data['id'];
$arcticles_count = mysqli_query($connection,$query);