adwarm — 2011-08-16T18:12:30-04:00 — #1
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.
frezno — 2011-08-16T18:20:49-04:00 — #2
starlion — 2011-08-16T18:22:41-04:00 — #3
adwarm — 2011-08-16T18:26:27-04:00 — #4
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
starlion — 2011-08-16T18:33:06-04:00 — #5
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.
adwarm — 2011-08-16T18:38:20-04:00 — #6
I've done this and still the same error comes up
Thank you for your continued help.
spikez — 2011-08-16T18:44:33-04:00 — #7
Can you post your query? It will make it easier to debug if we can see it.
adwarm — 2011-08-16T18:45:50-04:00 — #8
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")',
spikez — 2011-08-16T18:57:12-04:00 — #9
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.
adwarm — 2011-08-16T19:13:29-04:00 — #10
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.