我从表单字段获取数据。它包含如何从mqsql表中选择一半数据的数据
$city = "blr";
$field = "name";
$value= "mohai";
$sql = mysqli_query($con,"SELECT u.*, ad.*, ut.*, ci.*, st.* FROM user u, address ad, user_types ut, city ci, state st WHERE u.city_id=ci.id and ci.state_id=st.id and u.userId=ad.userId and
u.userType=ut.id and ci.city_name='".$city."' and u.".$field."='".$value."' and u.isDelete = '0'");
我正在使用上面的查询获取所有数据。 这里我的问题是
用户表中有name字段
对于前:数据在用户表 - >“mohaideen”
如果给name字段MOHAI。它应该过滤来自表格的数据。
如何为上述功能编写查询。