Following is my query and I would like to call PHP substr(); within Mysqlquery. Apparently, substr(ident.secondName, -2, 2) is working, but substr(ident.FirstName, 0, 2) is not working. Thank you in an advance!
mysqli_query($con, "select * from ident where ident.FirstName LIKE '%$first_name%'
OR substr(ident.FirstName, 0, 2) = '$first_two' OR ident.FirstName IS NULL AND
(ident.SecondName LIKE '%$second_name%' OR substr(ident.SecondName, -2, 2)
= $second_two' OR ident.SecondName IS NULL)");