I am trying to make a search box using select option tag such that if I select 'all' in select option tag then each data of that column should be fetched.
Given below is my php
code. Thanks
if(isset($_POST['submit'])) {
$area = $_POST['city'];
if(isset($_POST['work']!== 'all'))
{$work = $_POST['work']; }
else {$work = '*';} ;
$sel2 = "SELECT * FROM `userdata` WHERE `area`='".$area."' AND `work`='".$work."'" ;
$res2 = mysqli_query($con,$sel2);