SHARE
TWEET

function

a guest Aug 13th, 2017 53 in 3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function display_categories(){
  3.     global $connect;
  4.     $input = sanitize('category');
  5.     $query = mysqli_query($connect,"SELECT term_id FROM term_taxonomy WHERE taxonomy = '$input'");
  6.     while($row = mysqli_fetch_assoc($query)){
  7.         $category_id []= $row['term_id'];
  8.         $result = '\'' .implode('\',\'',$category_id).'\'';
  9.         foreach($row as $result){
  10.            
  11.             $query1 = mysqli_query($connect,"SELECT name FROM terms WHERE term_id = $result");
  12.             $fetch = mysqli_fetch_assoc($query1);
  13.  
  14.             ?>
  15.             <input type='radio' name ="<?php echo implode($fetch);?>"><?php echo implode($fetch);?>
  16.             <?php
  17.         }
  18.     }
  19. }
  20. ?>
RAW Paste Data
Top