I have an extensive procedure that runs directly in mysql works, now when I put it in php I get an error from the beginning that is creating a temporary table from where I will be getting data for the remainder of the report. This is the code that I try and when I execute it returns OK because the $ stmt - > execute () is running but the table is not created.
$stmt = Conexion::Conectar()->prepare("CREATE TEMPORARY TABLE
resultado_subdeterminante_temporal
(id int, idSubDeterminante int, posibles int, positivas
int)");
if($stmt -> execute()){
echo 'OK';
} else {
echo 'ERROR';
}
$stmt = null;
These are the Log MySql
2018-11-29 17:38:31 18908 [ERROR] Incorrect definition of table
mysql.column_stats: expected column 'min_value' at position 3 to have type
varbinary(255), found type varchar(255).
2018-11-29 17:38:31 18908 [ERROR] Incorrect definition of table
mysql.column_stats: expected column 'max_value' at position 4 to have type
varbinary(255), found type varchar(255).
Now if I take that query and execute it in mysql or phpmyadmin the table is created ok:
CREATE TEMPORARY TABLE
resultado_subdeterminante_temporal
(id int, idSubDeterminante int, posibles int, positivas
int)
I do not understand the error, what are the errors of the log?