Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbHost = 'localhost';
- $dbUsername = 'root';
- $dbPassword = '';
- $dbName = 'biblio';
- //connect with the database
- $db = mysqli_connect($dbHost,$dbUsername,$dbPassword,$dbName);
- //$db = new mysqli($dbHost,$dbUsername,$dbPassword,$dbName);
- //get search term
- $searchTerm = $_GET['term'];
- //get matched data from skills table
- $query = $db->query("SELECT term FROM dictionnaire WHERE term LIKE '%".$searchTerm."%' ORDER BY term ASC");
- while ($row = $query->fetch_assoc()) {
- $data[] = $row['term'];
- }
- //return json data
- echo json_encode($data);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement