日期:2014-05-16  浏览次数:20451 次

数据库 变量查询 字符串转换
printf("输入货号单:");


    char k[10];


gets(k);
   
sprintf(sql_update, "select * from huodan where 货单号='%s'",k);

     res=mysql_query(&myCont,sql_update);//查询 



这里是通过C语言将含有变量%s的变量保存在sql_update中。。。。在VC++ 中也是一样,找到转换函数就行,format。