下面用变量怎么不行??
td::string m_pasw = "luozhi";
std::string usSQL = m_ConnMysql->SprintSQL( "select * from ss_user where `name` = '%s' and m_user ");这样子又可以啊.....
std::string usSQL = m_ConnMysql->SprintSQL( "select * from ss_user where `name` = 'luozhi'");??????????

解决方案 »

  1.   

    模式匹配 :SELECT * FROM ss_user WHERE `name` LIKE '%s'
      

  2.   

    select * from ss_user where `name` = '%s' and m_userm_user 是什么?
    另外你的string什么时候替换的%s[align=center]====  ====
    [/align]
      

  3.   

    std::string usSQL = m_ConnMysql->SprintSQL( "select * from ss_user where name = '%s' + "'" + m_user +"'" ");
      

  4.   

     我要匹配一个变量啊.....m_user 是一个变量了...怎么用%s匹配了...
      

  5.   

    应该用逗号隔开
    std::string usSQL = m_ConnMysql->SprintSQL( "select * from ss_user where name = '%s'", m_user );