Hola tengo un problemita quiero por medio de php alterar una tabla donde el nombre de la columna nueva sera una fecha es decir tendra este formato 2012-05-28
archivo html:
Código HTML:
<form action="ListaGuardada.php" method="post">
Fecha<input type="text" name="f_date1" id="f_date1" maxlength="10"><button id="f_btn1">Seleccionar</button><br>
Código PHP:
mysql_query("ALTER TABLE Asistencias ADD COLUMN '$_POST[f_date1]' varchar(255) NOT NULL")or die(mysql_error());
Cuando lo ago directo desde mysql no me da problemas pero cuando lo con el codigo anteriot me da este error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2012-05-08' varchar(255) NOT NULL' at line 1