From: Anton <wa...@to...> - 2013-01-02 09:11:51
|
Hi. Just trying to write on tdbc::mysql instead of mysqltcl package. Can not do query like this: SELECT * FROM radcheck WHERE username LIKE '%test%'; code: set ffff "test"; set stmt [ mh prepare {SELECT * FROM radcheck WHERE username LIKE '%:ffff%'} ]; puts [$stmt allrows]; it returns nothing but when I change it to: set ffff "%test%"; set stmt [ mh prepare {SELECT * FROM radcheck WHERE username LIKE :ffff} ]; puts [$stmt allrows]; it works like expected. What is the right way to insert variable in " LIKE '%$var%' " style in tdbc::mysql prepare ? |