I started using PDO 2 days ago, but I want to know if the way I'm coding and the way I'm using it is the correct way of doing things with PDO.Please let me know if you guys notice any security flaws or improvements in general.Here is a function I wrote that shows updates.function ShowRemoveUpdates() {    ob_start();    try {      // connectie gegevens      require_once('connection.php');      // pagination      $start  = 0;      $limiet = 8;      if(isset($_GET['page'])) {        $page   = $_GET['page'];      } else {        $page   = 1;      }      // query      $stmt = $pdo->prepare('SELECT * FROM updates ORDER BY id DESC LIMIT :start, :limiet');      $stmt->execute(array(':start' => $start, ':limiet' => $limiet));      //start van formulier en tabel      echo <form method='post' action=''>;      echo <table id='tb1'>;      echo <th align='left'>Geplaatst door</th><th align='left'>Titel</th><th align='left'>Tekst</th><th align='left'>Tijd</th>;      // while loop door resultaten van query      if($stmt->rowCount() > 0) {        while ($row = $stmt->fetch()) {          $idje = $row['id'];          echo <tr>;          echo <td width='10%'>.$row['medewerker'].</td>;          echo <td width='30%'>.$row['titel'].</td>;          echo <td width='50%'>.$row['tekst'].</td>;          echo <td width='10%'>.$row['datum'].</td>;          echo <td><input type=\checkbox\ name=\checkvakje\ id=\checkvakje\ value=\$idje\></td>;          echo </tr>;        }        echo </table>;        echo <input type='submit' value='Verwijderen'>;      } else {        echo Geen resultaten gevonden.;      }      // Verwijder update functie      if(isset($_POST['checkvakje'])) {        $checkvak   = $_POST['checkvakje'];        $stmt = $pdo->prepare('DELETE FROM updates WHERE id = :checkvak');        $stmt->execute(array(':checkvak' => $checkvak));        header(Refresh:0);        exit();      }      echo </form>;      // count resultaten per rij en maak pagina nummering      $stmt = $pdo->prepare('SELECT * FROM updates');      $stmt->execute();      $rows = $stmt->RowCount();      $total=ceil($rows/$limiet);      if($page>1) {        echo <a href='?page=.($page-1).' class='button'>Vorige</a>;      }      for($i=1;$i<=$total;$i++)      {        if($i==$page) {          echo .$i.;          }        else {          echo <a href='?page=.$i.'>- .$i.</a>;        }      }      if($page!=$total) {        echo <a href='?page=.($page+1).' class='button'> - Volgende</a>;      }      // vang errors op    } catch (PDOException $e) {        echo Connection failed . $e->getMessage() . ;    }}
Using PDO to list and remove updates
beginner;php;pdo;pagination