- Edited
<div class="box">
<p>job title <span>*</span></p>
<input type="text" name="title" value="" placeholder="keyword, category or company" maxlength="200" class="input">
</div>
<div class="box">
<p>job location</p>
<input type="text" name="location" value="" placeholder="city, zip code,state, country or remote" maxlength="50" class="input">
</div>
<button type="submit" name="search" class="btn btn-primary">Search</button>
</div>`
`<?php
include 'config.php';
if(ISSET($_GET['search'])){
$keyword = $_GET['title'];
$query = mysqli_query($conn, "SELECT * FROM `products` WHERE `title` LIKE '%$keyword%' OR `company` LIKE '%$keyword%' OR `category` LIKE '%$keyword%' OR `description` LIKE '%$keyword%' OR `time` LIKE '%$keyword%' ORDER BY id DESC") or die(mysqli_error());
if(ISSET($_GET['search'])){
$word = $_GET['location'];
$query = mysqli_query($conn, "SELECT * FROM `products` WHERE `city` LIKE '%$word%' OR `state` LIKE '%$word%' OR `address` LIKE '%$word%' OR `country` LIKE '%$word%'OR `job` LIKE '%$word%' ORDER BY id DESC") or die(mysqli_error());
while($items = mysqli_fetch_assoc($query)){
?>
I have two search field, when I searching not working on both but when I coding one then perfectly. Could please let me know where actual problem. I am new in the sector. Please advice me if you have any alternative option.