Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. candy2
  2. -candy1
  3. -candy1
  4. -candy1
  5. candy2
  6. -candy1
  7. -candy1
  8. -candy1
  9.  
  10.  
  11.  
  12. $value= $_POST['value'];
  13.  
  14. $test = $wpdb->get_results( $wpdb->prepare("SELECT candy1, candy2
  15. FROM sweet
  16. WHERE candy2 = %s",$value));
  17.  
  18. $tree = array();
  19.  
  20. foreach ($filter as $key => $value){
  21. $tree[]= array($filter->candy2 => $filter->candy1);
  22. }
  23. echo json_encode(tree);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement