Discussion of article "How to Access the MySQL Database from MQL5 (MQL4)" - page 7

To add comments, please log in or register
chanokporn12131 kumboon
15
chanokporn12131 kumboon  
Budyoni DamyanovBudyoni Damyanov : :
ทำงานที่ยอดเยี่ยมฉันมีสอง EAs ใช้ MySQL ของคุณเชื่อมต่อบางส่วนของเขาสำหรับ MT4 บาง MT5 (ฉันมีเวลาที่ยากที่จะเขียนรหัสจาก MQL4 เพื่อ MQL5 แต่ตอนนี้ทุกอย่างทำงานได้อย่าง สมบูรณ์) ทำงานที่ยอดเยี่ยมฉันมีสอง EAs ซึ่งใช้ MySQL ของคุณเชื่อมต่อห้องสมุดบางส่วนของพวกเขาสำหรับ MT4 บาง MT5 (ฉันมีเวลาที่ยากที่จะเขียนรหัสจาก MQL4 เพื่อ MQL5 แต่ตอนนี้ทุกอย่างทำงานได้อย่างสมบูรณ์)
(ส่วนใหญ่เป็นราคาและข้อมูลใบสั่งซื้อ) - ฉันยังไม่ได้รีสตาร์ทเครื่องเท อร์มินัลการค้าหรือเซิร์ฟเวอร์ MySQL มานานกว่า 2 สัปดาห์ - ไม่มีการลดระดับประสิทธิภาพที่เห็นได้ ชัดหรือกา รั่วไหลของหน่วยความจำ, เขาทำงานพวกมีเสถียรภาพที่น่าสงสัย(ส่วนใหญ่เป็นราคาและข้อมูลใบสั่งซื้อ) - ฉันยังไม่ได้รีสตาร์ทเครื่องเทอร์มินัลการค้าหรือเซิร์ฟเวอร์ MySQL มานานกว่า 2 สัปดาห์ - ไม่มีการลดระดับประสิทธิภาพที่เห็นได้ชัดหรือการรั่วไหลของหน่วยความจำ, พวกเขาทำงานมีเสถียรภาพที่น่าสงสัย
เก็บงานที่ดี!เก็บงานที่ดี!
Khrisna Gunanasurya
26
Khrisna Gunanasurya  

Hi, why I got this message? how to fix it? 

Connection failed! Error: Can't connect to MySQL server on 'mysql.hostinger.co.id' (10061) <~~~ before it was 10060, i don't know why it's changing to that one

Can someone help me to solve it? I already tried googled it but I hit a wall.

Thank you

ilhan
67
ilhan  
Khrisna Gunanasurya:

Hi, why I got this message? how to fix it? 

Connection failed! Error: Can't connect to MySQL server on 'mysql.hostinger.co.id' (10061) <~~~ before it was 10060, i don't know why it's changing to that one

Can someone help me to solve it? I already tried googled it but I hit a wall.

Thank you

Hi Khrisna, Did you solve the mistake?
cikahun
6
cikahun  

Hi,

I have a question. I'd like to record the trade in MySQL table but always get an error message that the query is empty.

When I print the error and the query, it is there:

Error #1065: Query was empty; 3

Query: INSERT INTO algo_trades (date, time, curr, ticket, error, trade, lot, entry, sl, tp, spread) VALUES ('2017-9-1','14:3:58','GBPUSD',8705334,0,'Sell',2,1.29892,1.29961,1.29812,0.9)

What cloud be wrong? I'm using this library in another code in the same way, and works absolutely fine.

Thanks a lot Eugeniy for sharing it.

Alain Verleyen
37537
Alain Verleyen  
cikahun:

Hi,

I have a question. I'd like to record the trade in MySQL table but always get an error message that the query is empty.

When I print the error and the query, it is there:

Error #1065: Query was empty; 3

Query: INSERT INTO algo_trades (date, time, curr, ticket, error, trade, lot, entry, sl, tp, spread) VALUES ('2017-9-1','14:3:58','GBPUSD',8705334,0,'Sell',2,1.29892,1.29961,1.29812,0.9)

What cloud be wrong? I'm using this library in another code in the same way, and works absolutely fine.

Thanks a lot Eugeniy for sharing it.

Probably faster to use Google.

http://www.joellipman.com/articles/sql/error-1065-query-was-empty.html

SQL
  • 2012.12.13
  • Joel Lipman
  • www.joellipman.com
Posted on Dec 13, 12 at 01:12 PM What? In view of the fact that this error pops up in so many systems I take over, I have often gone down the wrong path following the red herring as it were when in fact the answer to this is very common. Why? Bespoke systems are the usual suspects. Developers will have told the system what to do when...
cikahun
6
cikahun  
Alain Verleyen:

Probably faster to use Google.

http://www.joellipman.com/articles/sql/error-1065-query-was-empty.html


Hi Alain,

Thanks a lot! I could figure it out what was wrong.

In my case the broker gives me the currency symbol with a £ sign. I've deleted it and it works.

Thanks again.

Khrisna Gunanasurya
26
Khrisna Gunanasurya  
I'm using multi-insert query but it doesnt works, but when I use single-insert, it works, this is the query 

Query = Query + "INSERT INTO `history` (an, oi, oc) VALUES (" + (string) AccountNumber() + ", " + (string) OrderTicket() + ", '" + (string) OrderComment() + "');";


what do i do wrong? it works with single-insert only

jlcash
12
jlcash  
cikahun:

Hi Alain,

Thanks a lot! I could figure it out what was wrong.

In my case the broker gives me the currency symbol with a £ sign. I've deleted it and it works.

Thanks again.

I am also encountering this error as my broker also suffixes symbols with (£). Does anyone know why this causes an issue and what the solution is? The SQL string works fine when entered into MYSQL Workbench but I get the "Query was empty" message when running the query through this library.
snz1991
5
snz1991  
Eugeniy Lugovoy:

Thanks for your time reading this artice. I've also checked your (https://www.mql5.com/en/code/11114), I've found such solution a long time ago (before MT4 build 600) and I liked the idea to make MQL and MySQL friendly. But just one thing I don't want to use is arrays to retreive the data from database. That's why I've built this solution for using with MT4 and MT5.

Also, I forgot to add x64-based project to the article, so you can download it right here, in discussion. Nothing was changed in sources, just DLL has been recompiled for x64.

Good luck,

Eugene 

hi Eugeniy Lugovoy , thanks for your article, I used  x32-based project in my (64bit windows with mql5) and I had this error :

2018.06.04 17:58:52.879    MySQL-001 (XAUUSD,H1)    Cannot load '..\libraries\MQLMySQL.dll' [126]

and now Im trying to use your x64-based project that you uploaded that in this forum but i still have above error .

I tried to run one of scripts in 2 ways ,

first I put dll files in this address : ...\MQL5\Libraries

second I put them in this address :  C:\Windows\SysWOW64

but neither of them worked . 

moose2089
5
moose2089  

Hi  Eugeniy Lugovoy 


I'm getting the following error not sure what is up!


The errors occurs on the MQLMySQL.mqh file

'StrToInteger' - function not defined MQLMySQL.mqh 224 10


'StrToDouble' - function not defined MQLMySQL.mqh 229 10

on the following lines of code:



int MySqlGetFieldAsInt(int pCursorID, int pField)

{

 return (StrToInteger(MySqlGetRowField(pCursorID, pField)));

}


double MySqlGetFieldAsDouble(int pCursorID, int pField)

{

 return (StrToDouble(MySqlGetRowField(pCursorID, pField)));

}


Kind Regards,



To add comments, please log in or register