I'm trying to find out how to search in a db row, but I have no IDEA... Maybe some of you guys can help out. I'm making a magic the gathering collection website for my boss. In this game you have multiple sets and each set had a card. Theres a page in which you can see all sets, and in this page I want a search bar to find the sets. Want I want is a search bar at the top of the page and when you typ in "Strong" you get to see every set name which contains "Strong".
Output : http://prntscr.com/5ubsa2 List continues quite a bit...
As you can see in the output, all the sets are listed. I want that you can see the search results there.
Input :
<body>
<?php
// Get data
$query = 'select * from sets ORDER BY releaseDate;';
$sets = $conn->query($query);
// Generate HTML
$htmlSets = '';
foreach($sets as $row){
$htmlSets .= '<div class="col-md-4 magic-set"><a href="'.$baseURL.'set.php?id='.$row['id'].'"><h5>'.$row['name'].'</h5></a></div>';
}
//set.php?fname=areg&lname=aerga
?>
<!-- Page Content -->
<div class="container">
<?php include_once 'inc/navigation.php';?>
<div class="content">
<div class="row">
<div class="col-md-12">
<div class="text-center">
<h3>Magic: the Gathering Sets</h3>
<hr>
</div>
</div>
</div>
<div class="row">
<?= $htmlSets ?>
</div>
<!-- /.row -->
</div>
<?php include_once 'inc/footer.php';?>
</div>
<!-- /.container -->
</body>