Edit database content with a web page I'm new to PDO, and I want to make sure I made this in the correct way. This way is working, but I have a feeling it's unclean.

I have this input:

$query = $handler-&gt;query('SELECT * FROM content WHERE id=1');
while($r = $query-&gt;fetch()) {
?&gt;
&lt;div id="content"&gt;
    &lt;div class="container"&gt;
    &lt;form action="&lt;?php echo BASE_URL ?&gt;admin/edit_process.php?edit_about" method="post" autocomplete="off" id="contact_form" name="contact_form" role="form"&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="message"&gt;Izmeni sadržaj sa početne strane:&lt;/label&gt;
          &lt;textarea class="form-control" id="message" name="message" required="" rows="6"&gt;&lt;?php echo $r['edit_about']; ?&gt;&lt;/textarea&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;button class="btn btn-success float-right" type="submit" name="submit"&gt;Sačuvaj&lt;/button&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;?php
}


Then it goes to this:

if(isset($_REQUEST['edit_about'])){
    if(!$user-&gt;isLoggedIn()){ Redirect::to(''.BASE_URL.''); }
  if(!$user-&gt;hasPermission('admin')) { Redirect::to(''.BASE_URL.''); }
    if(Input::exists()){
        try{
      $message = $_POST['message'];
      $sql = "UPDATE `content` SET `edit_about` = :message WHERE `id` = 1";
      $query = $handler-&gt;prepare($sql);
      $query-&gt;execute(array(
          ':message' =&gt; $message
      ));
            Redirect::to(''.BASE_URL.'index');
        }catch(Exception $e){
            die($e-&gt;getMessage());
        }
    }
}


And this is the output:

&lt;?php
$query = $handler-&gt;query('SELECT * FROM content WHERE id=1');
while($r = $query-&gt;fetch()) {
    echo $r['edit_about'];
}
?&gt;
The biggest problem with your PDO code is error reporting. die($e-&gt;getMessage()); is the worst method possible. Citing from my article on error reporting (which I highly recommend to read): 


for the casual user the error message is pretty cryptic and confusing
it it essentially useless for the site programmer/admin as they likely won't be browsing the site at the moment and will have no idea that error has been occurred
the information provided in the error message is extremely useful for a potential hacker, as it provides them with the feedback for their actions and may leak some sensitive information about your site


So never write a try..catch operator unless you have a certain scenario to be executed in the catch block as it will be useless and harmful. 

Another suggestion is just a matter of taste. Given you have only one variable in the query, you can use a positional placeholder instead of a named one, sparing yourself writing some extra code:

if(Input::exists()){
  $sql = "UPDATE `content` SET `edit_about` = ? WHERE `id` = 1";
  $query = $handler-&gt;prepare($sql);
  $query-&gt;execute([$_POST['message']]);
  Redirect::to(BASE_URL.'index');
}


As you may notice, the PDO code looks a bit different from the other code you are using. With a simple PDO wrapper could make this code even simpler and uniform:

if(Input::exists()) {
    $sql = "UPDATE `content` SET `edit_about` = ? WHERE `id` = 1";
    DB::run($sql, [$_POST['message']]);
    Redirect::to(BASE_URL.'index');
}


The example is taken from my PDO wrapper usage examples but you can use any wrapper you like.

Also, I don't know which framework you are using, but $_POST['message'] seems a bit alien to me. I would expect something like Input::get('message') instead.