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
Thanks for this new approach! I have tried different solutions but this one looks the best so far. I made a minor addition to your library where I return the number of fields for a SELECT query, using mysql_num_fields, so that I know how many fields I need to process and return in the MQL side. Thanks so much again for putting this together, really helped!!
MQL Code:
Thanks for this new approach! I have tried different solutions but this one looks the best so far. I made a minor addition to your library where I return the number of fields for a SELECT query, using mysql_num_fields, so that I know how many fields I need to process and return in the MQL side. Thanks so much again for putting this together, really helped!!
Thanks for the kind words. It's basic solution and it keeps general functionality I'm using in real.
I've used next rules during development of this solution: robustness, easy to study, simple using and minimal support.
Sure, you may change this project and add any addition functions regarding your project needs.
Good luck,
Eugene
Hello friends,
Well, if you like this solution and trying it for real projects (not just for fun) I have an update.
I'm starting to write new article about working with different databases, such as MS SQL Server, MS Access, Oracle, IBM DB/2, PostgreSQL.
The decision would be robust and easy to use like this one, but I have no time to complete it.
So, if you want to support this project can you send a few $$ over paypal for me: e.a.lugovoy@gmail.com
The amount of sum doesn't matter, I just would like to know is such decision really needs to be completed.
Thank you all,
Eugene
hello,Eugeniy Lugovoy~
I want to know why ‘ MySqlGetFieldAsDouble(Cursor, 3);’ can‘t write its value to data[i]?
Print("data[i]",data[3]);——always displa 0.0. what's wrong ? thank you sir!
for (i=0; i<Rows; i++)
if (MySqlCursorFetchRow(Cursor))
{
double data[] ;
ArrayResize(data,Rows);
data[i]= MySqlGetFieldAsDouble(Cursor, 3);
Print("data[i]",data[3]);
}
Hello friends,
Well, if you like this solution and trying it for real projects (not just for fun) I have an update.
I'm starting to write new article about working with different databases, such as MS SQL Server, MS Access, Oracle, IBM DB/2, PostgreSQL.
The decision would be robust and easy to use like this one, but I have no time to complete it.
So, if you want to support this project can you send a few $$ over paypal for me: e.a.lugovoy@gmail.com
The amount of sum doesn't matter, I just would like to know is such decision really needs to be completed.
Thank you all,
Eugene
hello,Eugeniy Lugovoy~
I want to know why ‘ MySqlGetFieldAsDouble(Cursor, 3);’ can‘t write its value to data[i]?
Print("data[i]",data[3]);——always displa 0.0. what's wrong ? thank you sir!
for (i=0; i<Rows; i++)
if (MySqlCursorFetchRow(Cursor))
{
double data[] ;
ArrayResize(data,Rows);
data[i]= MySqlGetFieldAsDouble(Cursor, 3);
Print("data[i]",data[3]);
}
You are trying to define array every time in cycle and print empty array item.
Try this:
So, you have to define array once before fetching cycle, then resize, and then write routine for getting data.
By the way, the number 3 in MySqlGetFieldAsDouble(Cursor, 3); means 4th column in SELECT list, because the numeration starts with 0, i.e. SELECT Open, High, Low, Close FROM ... means 0 - Open, 1 - High, 2 - Low and 3 - Close .
Hope this wil help.
Regards,
Eugene
You are trying to define array every time in cycle and print empty array item.
Try this:
So, you have to define array once before fetching cycle, then resize, and then write routine for getting data.
By the way, the number 3 in MySqlGetFieldAsDouble(Cursor, 3); means 4th column in SELECT list, because the numeration starts with 0, i.e. SELECT Open, High, Low, Close FROM ... means 0 - Open, 1 - High, 2 - Low and 3 - Close .
Hope this wil help.
Regards,
Eugene
Thanks for helping sir ,I have solved my problems about the array。You did a good job on mysql-mql indeed~!
Hello elugovoy
Awesome article and great libraries.
I'm trying to use your examples under MT5 but I'm getting this error:
2014.12.15 15:44:16.387 MySQL-001 'C:\Users\....\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\libraries\MQLMySQL.dll' is not 64-bit version
Are you running MT5 under 32-bit env?
Could you pleas help me with it?
Thanks very much!
Carmine Marrone.
Hello elugovoy
Awesome article and great libraries.
I'm trying to use your examples under MT5 but I'm getting this error:
2014.12.15 15:44:16.387 MySQL-001 'C:\Users\....\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\libraries\MQLMySQL.dll' is not 64-bit version
Are you running MT5 under 32-bit env?
Could you pleas help me with it?
Thanks very much!
Carmine Marrone.
Hello Carmine
The above in discussion I have attached project for x64, take a look and/or download from this post.
Hope this helps.
Regards,
Eugene