mysql - PreparedStatement and Array in c++ -


this how define array

  const int maxmatch = 10;   string a[maxmatch] = {"g111", "g112", "g113"}; 

with code below intend use array in query

  con->setclientoption("libmysql_debug", "d:t:o,/tmp/mysql.trace");   string a[maxmatch] = {"g111", "g112", "g113"};   pstmt = con->preparestatement("select lenght rods name = ? ");     (int = 0; < maxmatch; i++)     {       string lastmatch = a[i];       pstmt->setstring(1, lastmatch);               res = pstmt->executequery();          con->setclientoption("client_trace", &on_off);        res->afterlast();          while (res->previous())                cout << "\t... lenght ...: " << res->getint("lenght") << endl;       delete res;     } 

the code compiles, not result. there must wrong passing array setstring, not understand problem is.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -