[SOLVED] MySQL inserting blank data

Hi all,

I am currently having an issue with either PHP or MySQL and I dont seem to be able to find out what it is.

I have MAMP setup on my local system for development and everything seems to work fine without errors.

When I have uploaded it to my linode and I try to insert data to the database it tries to insert the data and everything seems to work correctly and I get no feedback saying that it has not been inserted incorrectly.

When I view the information in the database, all of the fields are left blank with the exception of the id field which is set to auto increment.

I would have said this is due to either a PHP coding error or MySQL syntax error, but this all works on my local MAMP server?

All of the select queries work correctly as the data is all being displayed on the pages. Also all the delete queries work correctly as the data can be deleted in the CMS side of the site.

I have tried using multiple MySQL usernames to make sure its not a permission issue including the root account but this still does not work?

Any help or advice is much appreciated

Thanks

Christian

2 Replies

It seems it was a syntax error and the data was not being escaped correctly when trying to insert it into the database.

Its very weird as the same code worked on my MAMP server :S

Thanks to anybody who had looked or been searching for a solution.

I know it's pretty old thread, but compare your php.ini settings. (best to check phpinfo() output). You probably have magic quotes enabled on one of the servers, and not on the other one.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct