我试图使用php获取mySQL值,但它不起作用。我在查询中使用别名。这是我的代码:
$selectedFeature = mysqli_query($db, "SELECT * FROM(SELECT * FROM token_preprocessing_latih WHERE id_term<=5112 ORDER BY tf_idf_normalisasi DESC) AS selectedFeature GROUP BY term ASC")or die(mysqli_error($db));
$feature = $feature*100;
while ($row = mysqli_fetch_assoc($selectedFeature)) {
$term = $row['term'];
$bobot = $row['tf_idf_normalisasi'];
mysqli_query($db,"INSERT INTO selected_feature VALUES('','$term','$bobot','$feature')")or die(mysqli_error($db));
}
我已在我的数据库中检查$term
和$bobot
值。它显示我的查询插入了错误的值。有人能告诉我如何解决它吗?谢谢。