how to add , edit and delete comma separated value of database .?

后端 未结 3 930
忘掉有多难
忘掉有多难 2021-01-14 11:42

i have created one table called role and the fields are like (roleid,role,prohibitedprocess,prohibitedports) here roleid is unique. and i have a comma separated value for \"

3条回答
  •  终归单人心
    2021-01-14 12:19

    You can edit the whole string . .

    I mean just using str_replace function

    e.g

    $string = "skype,teamviwer,notepad";
    
    $old_value = "skype";
    
    $new_value = "facebook";
    
    $new_string = str_replace($old_value,$new_value,$string);
    

    Then simply update this new string into database table. .

提交回复
热议问题