I am trying to save a form in the MySQL database, but when I try to execute to save, it shows me this error:
Column count does not match value count at row 1
In the form I only have the necessary fields, the others I do not put them since they must be empty in the BD.
This is my BD
id | cel | token | usuario | password | direccion | r_lat | r_lng | r_ruta | jornada | sede | r_tipo | acudiente | alumno | pos | mensaje | tarifa |
----------------------------------------------------------------------------------------------------------------------------------------------------
| | | | | | | | | | | | | | | | |
And this is the PHP that executes the form:
function myapp() {
global $connect;
$direccion = $_POST['direccion'];
$r_lat = $_POST['r_lat'];
$r_lng = $_POST['r_lng'];
$alumno = $_POST['alumno'];
$acudiente = $_POST['acudiente'];
$r_cel = $_POST['r_cel'];
$r_ruta = $_POST['r_ruta'];
$jornada = $_POST['jornada'];
$sede = $_POST['sede'];
$usuario = $_POST['usuario'];
$password = $_POST["password"];
$r_tipo = $_POST['r_tipo'];
$tarifa = $_POST['tarifa'];
$EncryptPassword = md5($password);
$query = "Insert into escolarBotar
(
direccion,
r_lat,
r_lng,
alumno,
acudiente,
r_cel,
r_ruta,
jornada,
sede,
usuario,
password,
r_tipo,
tarifa
) VALUES (
'$direccion',
'$r_lat',
'$r_lng',
'$alumno',
'$acudiente',
'$r_cel',
'$r_ruta',
'$jornada',
'$sede',
'$usuario',
'$password',
'$r_tipo',
'$tarifa',
'$EncryptPassword'
)";
mysqli_query( $connect, $query )or die( mysqli_error( $connect ) );
mysqli_close( $connect );
echo " Encrypted Password Added Successfully ";
}
I am new to PHP and MySql learning