MYSQL_TIME ts
MYSQL_BIND bind[3]
MYSQL_STMT *stmt
strmov(query, "INSERT INTO test_table(date_field, time_field,
timestamp_field) VALUES(?,?,?")
stmt = mysql_stmt_init(mysql)
if (!stmt)
{
fprintf(stderr, " mysql_stmt_init(), out of memory\n")
exit(0)
}
if (mysql_stmt_prepare(mysql, query, strlen(query)))
{
你的i_query是生成SQL文本文件吗,反复调用fprintf(i_query, "INSERT INTO stock_data values(%.2f,%.2f,%.2f)",v1,v2,v3)可以在文件中生成多行INSERT INTO语句,可以插入多行,但是你多个SQL语句之间应该有分号,你的这个语句可以修改如下:fprintf(i_query, "INSERT INTO stock_data values(%.2f,%.2f,%.2f)\n",v1,v2,v3)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)