Insertar datos en host

good day I have an error when inserting data, in my pc it inserts normal but in the host it throws me as not inserted Here I leave the code

<?php
include 'conexion.php'; if (isset($_FILES['foto'])) { $nombrefoto=$_FILES['foto']['name']; $ruta=$_FILES['foto']['tmp_name']; $destino="fotos/".$nombrefoto; $nombres=$_POST['nombres']; $apellidos=$_POST['apellidos']; $tipo=$_POST['tipo']; $identificacion=$_POST['identificacion']; $fecha=$_POST['fecha']; $rh=$_POST['rh']; $telefono=$_POST['telefono']; $correo=$_POST['correo']; $modalidad=$_POST['modalidad']; $club=$_POST['club']; $categoria=$_POST['categoria']; if (copy($ruta,$destino)) { $insertar="INSERT INTO `arqueros` ( `Id` , `Foto` , `Nombres` , `Apellidos` , `Tipo identi` , `Num identi` , `RH` , `Telefono` , `Correo` , `Modalidad` , `Club` , `Categoria` ) VALUES ('0','$destino','$nombres','$apellidos','$tipo','$identificacion','$rh','$telefono','$correo','$modalidad','$club','$categoria')"; $resultado=mysqli_query($db,$insertar); if ($resultado) { $alert = '<h2 style="color: black;">El usuario registrado</h2>'; }else{ $alert = '<h2 style="color: black;">El usuario incorrecto</h2>'; } } } ?>

If it works locally then fingers crossed it works on the free platform, just install it like you would any other script on live hosting and let me know how it goes?

If you are a beginner checkout http://bitdegree.org or
https://stackoverflow.com/questions/ask to troubleshoot your code with other developers/coders etc. Best checking the documentation for your script and communicating with the script author or troubleshooting it locally or alternative hosting to make sure it isn’t a limitation of the free plan.
Our team would be more than happy to help you with any problem you encounter. However, we will only provide free support for our system and services. We will help you with basic problems associated with getting scripts running such as advising you of the correct hostname, username, database name and information to us, but if you need help with third-party software, contact the authors of that software or query Google with error message you get.

It is not possible for us to provide help for everyone, fix PHP errors or develop your website as it would require a lot of administrative time. We focus in getting our servers and services up and running.

However, you can upgrade your account at https://www.hostinger.com/special/000webhost?utm_source=000webhost&utm_medium=frontend&utm_campaign=moderator and we will provide you with full help in installing your scripts, developing your website and fixing errors.

Thank you

Try opening .htaccess file in public_html and add the line of

php_value output_buffering on

I no longer throw the error no insertion, but the data does not reach the database

Try toggling PHP version of your website?

I already alternate it to the lower version but it doesn’t work,
Should I make any changes to the php code?

This topic was automatically closed after 3 days. New replies are no longer allowed.