I would like to ask you if it is neccessary to check $_POST before db insertion even in cases that I know that user must fill these inputs by some data.
And if yes, what is the best way? Because now I use this, but it is quite time consuming to write every one, if I have more inputs.
    if ( isset($_POST['id']) ) {
        $id = $_POST['id'];
    }
    if ( isset($_POST['title']) ) {
        $title = $_POST['title'];
    }
    if ( isset($_POST['text']) ) {
        $text = $_POST['text'];
    }
    if ( isset($_POST['tag']) ) {
        $tag[] = $_POST['tag'];
    }
    ...
    // edit data in db
Thank you
 
     
    