Reputation: 419
code
void write_token_to_data()
{
int count=0;
string str;
typedef double* DynamicMatrix[l+m];
// DynamicMatrix Count;
typedef double* DynamicMatrix2[l+m];
//DynamicMatrix2 Prob;
for(int i=0; i<(l+m); i++)
{
for(int j=0; j<(l+m); j++)
{
//--------------------------------------------------
if (count >100 || count == 0)
{
// execute the string
//mysqlinsert(str);
// initialize str as empty string
str = "INSERT INTO EM ( sourceindex,targetindex,source,target) VALUES";
count = 0;
}
if (count <= 100)
{
// concatinate the string with prev str
str +=(i,j,combine[i],combine[j])+',';
cout<<str<<endl;
count++;
}
}
}
//outfile.close();
}//end of function
the question is about the str go to the sql query and i found i cout the code of str and str disapear the '(' ,')' and i and j i and j should be the index number and type is integer how can i change this code without wrong
Upvotes: 0
Views: 43
Reputation: 296
try like this !!!! Not tested
str += '('+ i +',' + j +',' + combine[i] + ',' + combine[j] ')'+',';
Upvotes: 1