Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $specialties = $wpdb->get_results("SELECT * FROM specialties ORDER by name ASC"); ?>
- <select class="form-control" name="specialty">
- <?php foreach($specialties as $specialty){ ?>
- <option value="<?php echo $specialty->id; ?>"><?php echo $specialty->name; } ?></option>
- </select>
- $s = esc_sql($_GET['specialty']);
- $sql = "SELECT id, name
- FROM specialties
- WHERE";
- if(!empty($s)) {
- $sql .= " specialty LIKE '%$s%'";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement