How use the insert query using parameters?

前端 未结 5 2018
猫巷女王i
猫巷女王i 2020-12-19 15:42

When i try with this query i get an error says that Perameter email doesn\'t exist, i am sure that the variables : email, login_pass, payment_method,operateur are valid and

5条回答
  •  半阙折子戏
    2020-12-19 16:25

    Found the answer !

    MySQLQuery2.SQL.Clear;
    MySQLQuery2.SQL.Add('INSERT INTO COUNTRY (NAME, CAPITAL, POPULATION)');
    MySQLQuery2.SQL.Add('VALUES (:Name, :Capital, :Population)');
    MySQLQuery2.Params[0].AsString := 'Lichtenstein';
    MySQLQuery2.Params[1].AsString := 'Vaduz';
    MySQLQuery2.Params[2].AsInteger := 420000;
    MySQLQuery2.ExecSQL;
    

    Thankyou All !!

提交回复
热议问题