I am getting data from form field. It contains
$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'");
I am using above query for getting all data. Here my question is
user table has name field
For ex: the data is in user table-> "mohaideen"
If i give the name field mohai. It should filter the data from table.
How can i write a query for above functionality.