All this code below used to work! I then changed troop to group and since then its not been inputing into the database! I've debugged and all the information is coming through, its just not going into my database.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, name, tel, place, activity) VALUES ('11-7-2012','11-8-2012','swl7@gm' at line 1
INSERT INTO activities (datearriving, dateleaving, email, group, name, tel, place, activity) VALUES ('11-7-2012','11-8-2012','email@example.com','groupsev','swl7','0987654321','ash','Archery range')
The only thing I changed were the words troop to group then it started failing lol
They are for different purposes. The back-quotes are for "identifiers": table names, column names, and such. Regular "straight" quotes are for string literals, so those will still be used around actual text/character values.
INSERT INTO `my_table` (
) VALUES (
1234, -- integer column
'This is a test.
It is only a test', -- text column
'fubar' -- varchar column
The back-quoting is optional when there is no name clashing with reserved words and the name itself does not have spaces or other normally invalid characters in it, but it never hurts to back-quote them, so many people just quote all identifiers for consistency.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation