Problem with selected subcategory when editing Category items

后端 未结 3 1125
萌比男神i
萌比男神i 2021-01-28 04:54

I want to item\'s subcatory selected when editing category:



        
3条回答
  •  渐次进展
    2021-01-28 05:31

    You need to use the global keyword inside the function:

     function sQuery()
     {
        global $r['id'];
        global $subcat;
    
        if ($r['id'] == $subcat) {
          $t = "selected";
        } 
        else {
    
          $t = "";
        }
       return $t;
      }
    

提交回复
热议问题