Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $db = "artikel";
- $conn = new mysqli($servername, $username, $password, $db);
- $search = '';
- if (array_key_exists('search', $_GET)) {
- $search = $_GET['search'];
- }
- echo $search;
- if(isset($_POST['submit'])) {
- //$sql = "SELECT d_prijs, c_prijs, code, artikelNL FROM artikel WHERE '" . $_GET['input'] . " ' LIKE '%" . $_GET['input'] . "%' ";
- // $result = $conn->query($sql);
- $sql = "SELECT d_prijs, c_prijs, code, artikelNL FROM artikel WHERE * LIKE '%" . $search . "%'";
- $result = $conn->query($sql);
- if ($result = $conn->query($sql)) {
- /* fetch object array */
- while ($row = $result->fetch_row()) {
- echo $row;
- }
- /* free result set */
- $result->close();
- }
- }
- ?>
- <form method="get" action="">
- <input id="search" name="input" type="text" placeholder="search">
- <input type="submit" name="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement