Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function haschild2($parent_id=0)
- {
- $row=false;
- $sql="SELECT `id`, `name`, `parent_id` FROM `beh_cat_article` where `id`=$parent_id";
- $data=$this->db->query($sql)->result_array();
- if($this->db->query($sql)->num_rows()>0)
- {
- foreach($data as $key=> $value)
- {
- $id=$value['id'];
- $sql="SELECT `id`, `name`, `parent_id` FROM `beh_cat_article` where `parent_id`=$id";
- $option='<option value="'.$value['id'].'>'.$value['name'].'</option>';
- return $option;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement