I cannot insert data into my database via a php code

Hey, try to register an account manually from your database and copy the code that is written after you succeed in doing it. That being said, you paste the code into the prepare function and edit the user id to a higher value. Finally, you will need to execute the code once more and see if it succeed in inserting the data into your database.

If the data is inserted in the database then you can change all the necessary information in php, prepare function for example change the username to a variable. Hopefully, it will work.

I had a similar problem and it seemed that PHP in hosting sites is built differently from private hosts such as xampp. Basically, your code is correct but I think it needs to be more specific for the database to read.

1 Like