求 vc 访问postgresql 实例一份 多谢

求 vc 访问postgresql 实例一份 谢谢!

如题

谢谢!



手册中的例子。

MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html

C/C++ code

char query[1000],*end;

end = strmov(query,"INSERT INTO test_table values(");
*end++ = '\'';
end += mysql_real_escape_string(&mysql, end,"What is this",12);
*end++ = '\'';
*end++ = ',';
*end++ = '\'';
end += mysql_real_escape_string(&mysql, end,"binary data: \0\r\n",16);
*end++ = '\'';
*end++ = ')';

if (mysql_real_query(&mysql,query,(unsigned int) (end - query)))
{
   fprintf(stderr, "Failed to insert row, Error: %s\n",
           mysql_error(&mysql));
}


                        
  
  
                    
求 vc 访问postgresql 实例一份 多谢

相关文章:

你感兴趣的文章:

标签云: