I am a relative newbie, I have some programming experience in PHP and Mysql but haven't done much for a few years. I am writing a program that requires the user to input data. I have written the following "INSERT" queries and cannot understand why I get the results that I do.
1) This works in the program and in the PHPMyAdmin sql tab for the table-
"INSERT INTO Player(PlayerNo, Surname, FirstName, PreferredName, Dob, Street, TownSuburb, State, Postcode, AgeAtStart, Handicap, Grade, StateRep, Status) VALUES (NULL, 'Smith', 'Peter', 'Pete', '1976-03-10','5 Broad St', 'Kingston', 'Qld', '4114', '38', '16', 'B', 'Qld', 'Police')"
2) This works in the PHPMyAdmin sql tab for the table but not in the program -
"INSERT INTO `Group` (`GroupId`, `GroupNo`, `Day`, `Tme`) VALUES (NULL, '5', '2', 'AM')"
3) This doesn't work in either -
"INSERT INTO Group (GroupId, GroupNo, Day, Tme) VALUES (NULL, '5', '2', 'AM')"
As you can see the syntax is quite differently in the two that work but the same in (1) and (2) where one works and one doesn't.
Any suggestions.
1) This works in the program and in the PHPMyAdmin sql tab for the table-
"INSERT INTO Player(PlayerNo, Surname, FirstName, PreferredName, Dob, Street, TownSuburb, State, Postcode, AgeAtStart, Handicap, Grade, StateRep, Status) VALUES (NULL, 'Smith', 'Peter', 'Pete', '1976-03-10','5 Broad St', 'Kingston', 'Qld', '4114', '38', '16', 'B', 'Qld', 'Police')"
2) This works in the PHPMyAdmin sql tab for the table but not in the program -
"INSERT INTO `Group` (`GroupId`, `GroupNo`, `Day`, `Tme`) VALUES (NULL, '5', '2', 'AM')"
3) This doesn't work in either -
"INSERT INTO Group (GroupId, GroupNo, Day, Tme) VALUES (NULL, '5', '2', 'AM')"
As you can see the syntax is quite differently in the two that work but the same in (1) and (2) where one works and one doesn't.
Any suggestions.