The code is the following:
if (mysqli_multi_query($conn, $query)) {
$token = $_POST['token'];
$query = "
INSERT INTO _usuarios (
login_usuario,
nombre_usuario,
password_usuario,
id_perfil,
fecha_creacion_usuario,
id_usuarioCreate)
VALUES (
'$token',
'$token',
'$passCreate',
6,
NOW(),
1
);";
if ($conn->query($query) === TRUE)
{
echo "User created successfully";
}
else
{
echo "Error creating user: " . $conn->error.$query;
}
}
Everytime I run the multiquery (which in this case is a very large sql script for a database creation) and I try to execute the INSERT below, I get the same message:
'Table _usuarios doesn't exist'
I believe that it is because the script hasn't finished running by the time I'm trying to do the insert.
Any ideas?