After my connection to database, I surely insert elements to my table one by one, but I do not have any idea about inserting elements from an array, vector..etc to tables. Following query is that I tried, but no effects on table.
mysql_query(connection,"insert into mytable (id) values(arr[0])");
C/C++ don't interpolate values into a string as most scripting languages do. You'll have to use string operations to build the query string, e.g. (in pseudo-code):
instead. C has absolutely no way of knowing that
arr[0]
in that query string should be treated as an array reference, and not just plain text that happens to look like one. Hence having to build the string yourself.