So let's go through this.
kumerbakul if(ISSET($_GET['search'])){
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)){
if(isset($_GET['search'])) {
If the search
field is set then:
$keyword = $_GET['title'];
Get the title
field and put it in $keyword
. Then
$query = mysqli_query($conn, ...) or die(...);
Do a query. Then
if(isset($_GET['search'])) {
If the search
field is set (and we know it is because we just checked and never finished that part of the code) then:
$word = $_GET['location'];
Get the location
field and put it in $word
. Then
$query = mysqli_query($conn, ...) or die(...);
Do a second query. Then
while($items = mysqli_fetch_assoc($query)){
Go through the results of the last query made.
You're not seeing the logical failure here? You make two queries but you are only fetching results from one of them.