Advertisement
Daniel_Dropik

wcmcAJAX.php

May 20th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. //absolute path to wp-load.php, or relative to this script
  3. //e.g., ../wp-core/wp-load.php
  4. //include( '../../hostcals.localhost/wp-load.php' );
  5.  
  6. //grab the WPDB database object, using WP's database
  7. //more info: http://codex.wordpress.org/Class_Reference/wpdb
  8. global $wpdb;
  9. global $customTerms;
  10.  
  11. //make a new DB object using a different database
  12. //$mydb = new wpdb('username','password','database','localhost');
  13. $mydb = new wpdb('****','*****','*****','******'); //hidden for my protection
  14.  
  15. $allUsers = $wpdb->get_results("SELECT * FROM $wpdb->users");
  16. $custTermQuery = "SELECT slug FROM wp_47_terms";
  17.  
  18. $customTerms = $wpdb->get_results($custTermQuery); ?>
  19. <pre>
  20.  <?php// print_r($customTerms); ?>
  21. </pre>
  22.  
  23. <?php function wcmcAutoComplete($customTerms){
  24.     return json_encode($customTerms);
  25.     } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement