Mysql where clause in visual c++
Posted on 2004-09-29
I have a program in visual c++ .net that connects to a remote Mysql server.
Everything works just fine, I only have a problem when I execute a Mysql query to retrive data:
if I use the following it works just fine
format = _T("SELECT * FROM clienti WHERE Client_code LIKE '%s'");
if I try to use this:
format = _T("SELECT * FROM clienti WHERE Client_code LIKE '%s' || Name LIKE '%s'");
where I only added "OR" to wide the search, either gives no result at all or only gives results of the first where clause "Client_code LIKE '%s' "
I wonder if I need a special syntax to implement "OR" and "AND" statement in visual c++ .net and libmySQL.
Do you have any ideas??