MySQL Insert into syntax lazarus / 16-Databases ---------------------------------------------------------------------- TheOddOne · 2014-12-01 00:03 QuoteProcedure TMySQLRead.StudentNamesButtonClick(Sender: TObject); Var   UsernameCorrect : Boolean;   TStudentName , TUnitName , TTeacherComments : String;   TStudentMark : Integer;   TStudentGrade , TStudentPredictedGrade : Char; Begin TStudentName := 'Bob'; TUnitName := 'Health and safety'; TStudentMark := 50; TStudentGrade := 'B'; TStudentPredictedGrade := 'A'; TTeacherComments := 'Good work'; Try   SQLScript.SQL.Add('INSERT INTO Student(StudentName,UnitName,StudentM ark,StudentGrade,StudentPredictedGrade,TeacherComments) VALUES (:TStudentName, :TUnitName, :TStudentMark, :TStudentGrade, :TStudentPredictedGrade, :TTeacherComments)');   SQLScript.ExecSQL; Finally   SQLScript.Close; End; End; When I execute this, it doesn't actually send anything just nulls to my db loool. Why is this? IMAGE: http://i.imgur.com/EZYkw7M.png ---------------------------------------------------------------------- Leledumbo · 2014-12-01 03:48 Because you didn't set the parameter values. After setting the SQL, you must set each parameter to its value using ParamByName (or other mechanisms). Pascal level variable (in the var section) has nothing to do with SQL level one (in the query string), despite they have the same name. ---------------------------------------------------------------------- TheOddOne · 2014-12-01 04:25 All working, ^^ thanks.