My PHP script was working fine, now its just suddenly stopped working and is now giving me the following error:
Fatal error: Call to undefined function dies() in /home/****/public_html/****/submit.php on line 52
On line 52 is the following:
mysql_query($query) or dies(mysql_error());
Any reason to why my script has just suddenly stopped working?
Any help would be great.
Oops sorry i didnt see your comment on that. Thanks guys.
Now i have another problem, i now get the message:
Column count doesn't match value count at row 1
Right. I thought this might be coming.
In your query, you do this:
"INSERT INTO tablename VALUES (value1,value2, etc....)"
the problem is you're not inserting as many values as there are columns. (or too many.)
To make it easier to keep track, I suggest you add the field names to the query:
"INSERT INTO tablename(field1,field2....) VALUES (value1,value2...)"
That way you know you're lining things up correctly.
I've done this and still the same error comes up
Thank you for your continued help.
Can you post your query? It will make it easier to debug if we can see it.
Here you go
'INSERT INTO data (LeadID, AffID, ProID, Mr, FirstName, LastName, Email, DOB, IP, Sub_ID, Date, Time, EmailValid, EmailReason) VALUES ("", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s")',
OK, check the number of fields, the number of %s values and also the actual values to be used. If the first field is an auto increment field then you dont need to include it in your insert statement.
Big thank you again guys, you have yet again helped me, if you want me to donate some money to a charity let me know which charity. I like to give something back for people that help me out.