I have made a EA to get some data and insert it into my sql database but I got this error when I try to insert , the insert function is in a timer .
bool insertMt4Finance(){
string queryInsertMt4String;
if(userExist()){
string serveur,currency,createdon,login; double firstdeposit; serveur = (string)AccountInfoString(ACCOUNT_SERVER); currency = (string)AccountInfoString(ACCOUNT_CURRENCY); createdon = TimeToString(TimeLocal(), TIME_DATE|TIME_SECONDS); login = (string)AccountInfoInteger(ACCOUNT_LOGIN); firstdeposit = AccountInfoDouble(ACCOUNT_BALANCE);
double profit,credit; profit = AccountInfoDouble(ACCOUNT_PROFIT); credit = AccountInfoDouble(ACCOUNT_CREDIT);
queryInsertMt4String = "INSERT INTO `MT4_FINANCE`(mt4_finance_uid,mt4_id,mt4_balance,mt4_profit,mt4_bonus,mt4_financeDate) VALUES ("+ GetUniqueInstanceName(login) + "," + login + "," + firstdeposit + "," + DailyProfit() + "," + credit + ",'" + createdon + "')"; uchar queryInsertMt4[]; StringToCharArray(queryInsertMt4String,queryInsertMt4,0,StringLen(queryInsertMt4String));
int length=StringLen(queryInsertMt4String); mysql_real_query(mysql,queryInsertMt4,length);
Print("Row Insert Success, insertMt4Finance"); return true;
}else { Print("Account Does Not Existe , insertMt4Finance"); return false; }
}
I thinks is a error from the SQL file DLL:
Error Access violation read to 0x00000000
Thanks
User contributions licensed under CC BY-SA 3.0