|
For my site, I have a page using php to insert a record into a table in my database. The problem I have come across is that it works absolutely fine when testing on my apache localhost, but when I try it live into my mysql database on my 1and1 server it will not insert the record.
I am using dreamweaver and the connection settings are fine, as there are other areas on the site that insert/update/delete records fine using the behaviours from dreamweaver. In this page though, I am hand coding the php as the data to be inserted is not from a form so I am using the simple code:
mysql_query("INSERT INTO products (product_name, product_description, product_thumb, prodcat_id, product_price, product_special)
VALUES ('football', 'a red football', 'ball.jpg', '2', '10.99', 'Y')");
Like I say, I have correctly defined the database connection but it seems very odd that it will work on my apache localhost/mysql setup but not the live server/database. I have even tried different pieces of code for inserting the record, even copying the suggested php code from phpmyadmin on the live database but to no avail.
|