I can't add data to my sql database using a php file

Website URL

(please specify the URL of the site on which you are experiencing the problem)

Error Message

This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support

Other Information

I have uploaded my files in htdocs in a folder and when I use postman to add my data in my database I get this error message. And if I put the same address in the browser (without a body) I get an empty browser. I know my php files work on my local host. I just can’t get the path to work. I have test with a basic html file named index.html and it shows in my browser when I access it via the net. So I don’t know what to check and I need some help.
Thank you

Using non-browser tools to interact with your site is not allowed:

Do the files show up in the database? Did you try turning on error message?

Great! Note that localhost is a development platform, and settings and such are going to be different. Also, localhost is missing quite a bit of security features that production servers have. Just because your code works there does not mean it will work anywhere else.

7 Likes

I’ve turned on the error messages in the php sections, but how can i check if my files show up in the database? I cannot create a new row of data if that is what you mean?

Reload the page, any error messages appear?

files? Saving files to a database is probably not the best idea …
What are you trying to do? You said you can’t add data the database, so when you load the script, does the data you are trying to add get added?

6 Likes

You can check the contents of your database through phpMyAdmin, found in the client area under the Databases menu.

It also helps to make sure your code is properly checking for errors. For example mysqli_stmt_execute will return true or false if it was successful or not, and if it wasn’t, you can get the error message with mysqli_error.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.