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