Calling a custom made table with $wpdb
-
This bit is for an auto-complete script I’m trying to implement. I created a table called ‘wp_cities’ and filled it with cities and I want to call that table below. Right now it calls tags.
How can I get the code to call all the values from the wp_cities table?
<script type="text/javascript"> $(document).ready(function(){ var data = '<?php global $wpdb; $search_tags = $wpdb->get_results("SELECT * FROM $wpdb->terms"); foreach ($search_tags as $mytag){ echo $mytag->name. " "; } ?>'.split(" "); $("#s").autocomplete(data); }) </script>
Any help is appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Calling a custom made table with $wpdb’ is closed to new replies.