Try something like this:
int x = 1; string name = "Paul"; int age = 32; string address = "California"; double salary = 25000.00; DatabaseBind(db, "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (?,?,?,?,?)", x, name, age, address, salary);I think this is more like an SQL problem than a mql5.
No it did not work again
Check this article:
Simplifying Databases in MQL5 (Part 1): Introduction to Databases and SQL - MQL5 Articles
It has a part about inserting (sql).
Simplifying Databases in MQL5 (Part 1): Introduction to Databases and SQL
- 2025.08.27
- www.mql5.com
We explore how to manipulate databases in MQL5 using the language's native functions. We cover everything from table creation, insertion, updating, and deletion to data import and export, all with sample code. The content serves as a solid foundation for understanding the internal mechanics of data access, paving the way for the discussion of ORM, where we'll build one in MQL5.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register

Now if we want to insert a variable x=1 instead of 1, how can we do it?
I tried the following but it didn't worked: