lundi 22 avril 2019

Mysql gives error when LIKE contains a number in libmysql++-dev

Following 2 cases, 1 is working in C++ but the next not:

  1. SELECT id,local_name,chinese_name FROM store_smurf WHERE local_name LIKE '%A%' ORDER BY local_name
  2. SELECT id,local_name,chinese_name FROM store_smurf WHERE local_name LIKE '%1%' ORDER BY local_name

Any number between 0 and 9999 causes a problem, but names are no issue for libmysql++-dev. In Mysql itself this is not a problem ( when I add ; ). Here the essential code:

        mysqlpp::Query q( connection, false, query.c_str());
        q.parse();
        m_ares =q.store()

Any tip would be appreciated.

Aucun commentaire:

Enregistrer un commentaire