i want data mssql db using pdo class , using % % clause
i want find username: mozzey0410
if search mozzey04 or mozzey041 can find it. if try use full name: mozzey0410 no records given. how fix this? want search full or partial name using same query.
$user2 = $db->prepare("select top 100 memb_guid,memb___id,mail_addr,gender,country memb_info memb___id ? , mail_addr ?"); $user2->bindvalue(1, $userid . '%'); $user2->bindvalue(2, $mail . '%'); $user2->execute(); $user = $user2->fetchall();
try
$user2 = $db->prepare("select top 100 memb_guid,memb___id,mail_addr,gender,country memb_info memb___id concat('%',?,'%') , mail_addr ?");
and bind value without '%'
Comments
Post a Comment