It turns out that I have a php with data and one of these is a date and I want to put it as the name of a column but I get an error, they know how I can do it so that I do not get that error, this is the php
<?php
require('../../conexion.php');
$fecha=$_POST['fecha'];
$id=$_POST['id'];
$asistencia=$_POST['asistencia'];
$sql="ALTER TABLE asistencias ADD $fecha varchar(15) NOT NULL";
$result=$conexion->query($sql);
if($result)
{
$sql2="UPDATE asistencias "
. "SET "
. "$fecha='$asistencia' "
. "WHERE Id=$id";
$result2=$conexion->query($sql2);
if($result2)
{
}
else
{
echo 'error';
echo $sql2;
}
}
else
{
echo 'error';
echo $sql;
}
?>