我想从数据表中删除一行,因此我需要从数据库中获取id值,然后将其删除。
$id = $_GET['id'];
$result = mysqli_query($con, "DELETE FROM registre where id=$id");
此代码没有从数据库获取id值,我的数据表中没有id的行,因此我需要从db获取然后删除它。
答案 0 :(得分:1)
尝试使用前置语句:
List<String> titles = Arrays.asList("First Name", "Last Name");
firstClassList
.stream()
.flatMap(firstClass -> firstClass.getSecondClassList().stream())
.forEach(secondClass -> {
List<ThirdClass> filteredThirdClasses = secondClass.getThirdClassList()
.stream()
.filter(thirdClass -> titles.contains(thirdClass.getField()))
.collect(toList());
secondClass.setThirdClassList(filteredThirdClasses);
}
);
答案 1 :(得分:-1)
尝试这个也许有帮助
$id = $_GET['id'];
$result = mysqli_query($con, 'DELETE FROM registre where id=' . $id);