MySQL connection

 

Hi!

I'd like to insert data directly from a MetaTrader 4 EA, and it hangs at first line: mysql = mysql_init(mysql);

Here's my code, where did I make a mistake?

Thanks!

#import "libmysql.dll"

int mysql_init(int db);

int mysql_errno(int TMYSQL);

int mysql_real_connect(int TMYSQL, string host, string user, string password,

string DB,int port,int socket,int clientflag);

int mysql_real_query(int TMSQL, string query, int length);

void mysql_close(int TMSQL);

#import

int mysql;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init()

{

mysql = mysql_init(mysql); // <-- it hangs here

...
 

Welcome to mql4.com forum,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

 
cicc1981:

Hi!

I'd like to insert data directly from a MetaTrader 4 EA, and it hangs at first line: mysql = mysql_init(mysql);

Here's my code, where did I make a mistake?

Thanks!


There are several topics about mysql on this site, please do some searches.
Reason: