我想删除一个具有特定标题的表列。这个查询有什么问题?如果我添加delete-URL(带有请求的标题;…?name=)在我的浏览器中,我得到最后的echo (Error-message)
<?php
//Getting Id
$name = $_GET['name'];
//Importing database
require_once('dbConnect.php');
//Creating sql query
$sql = "ALTER TALBE tische DROP `$name`";
//Deleting record in database
if(mysqli_query($con,$sql)){
echo 'Element erfolgreich aus Abrechnung entfernt';
}else{
echo 'Konnte Element nicht aus Abrechnung entfernen';
}
//closing connection
mysqli_close($con);
语法为:ALTER TABLE table_name DROP COLUMN column_name