Recently transferred a site and the database over to one of my servers. For some reason im getting an "error: cant insert data into database" I found the string where this is... mysql_db_query($database, "INSERT INTO ftont VALUES ('$timestamp','$ip')") or die("Error: Can't insert data into database'"); Everything else is working good i tested my connection and it worked...but this isnt working for some reason...i dont know. Im confused. someone help me please........
mysql_db_query($database, "INSERT INTO ftont VALUES (null,'$timestamp','$ip')") or die("Error: Can't insert data into database'");
http://sidekickprofiles.com/ Now it shows a blank page and i get that...before it was showing some content now i get that.
If you want to know the reason for the error condition, you should change the message to something more informative. For example: ... or die(mysql_error());
Then there is a discrepancy between what you try to add to the database, and the numbers of columns in the database (table). Is there perhaps another column in the database?
Hit me up on messenger (ones in my profile or here) I can help you out. I'll get it all figured out for you.
Ok, now that we have the actual error message it's easy to figure out. In an insert statement, you are almost always better off specifying which columns the data go into. For example, if you have one column called "when" and one called "from_where", then you could write your query as: ... "insert into ftont (when, from_where) values ('$timestamp', '$ip')" ... this way it knows that you want $timestamp to go into 'when', and $ip to go into 'from_where'. Otherwise, it will guess. It will put the first value in the first column of your table, the second value in the second column, and so on. And it will fail if the number of values is not exactly identical to the number of columns.