Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function haschild2($parent_id=0)
  2. {
  3. $row=false;
  4. $sql="SELECT `id`, `name`, `parent_id` FROM `beh_cat_article` where `id`=$parent_id";
  5. $data=$this->db->query($sql)->result_array();
  6.  
  7. if($this->db->query($sql)->num_rows()>0)
  8. {
  9. foreach($data as $key=> $value)
  10. {
  11. $id=$value['id'];
  12. $sql="SELECT `id`, `name`, `parent_id` FROM `beh_cat_article` where `parent_id`=$id";
  13. $option='<option value="'.$value['id'].'>'.$value['name'].'</option>';
  14. return $option;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement