i have made a logon script but he must give a output parameter "relatieid" but if i do print relatieid i don't get the output parameter. what can i do to get the output parameter. i must give -1 if your logon data don't be good and your relatie id if you are succesfull logon. i saw that you can use fatchall but how

my script is:
PHP Code:
<?php
session_start
();
$sessieid session_id();
error_reporting(-1);
ini_set('display_errors'1);

if(
$_SERVER['REQUEST_METHOD'] == 'POST')
{
     
$username $_POST['username'];
     
$wachtwoord $_POST['wachtwoord'];
     
$ip $_SERVER["REMOTE_ADDR"];
     
$computernaam php_uname('n'); 
 
     if(
trim($username) == '')
     {
        echo 
"<font color='red'>Vul geldige gebruikersnaam in!</font><br>";
        
header("refresh:5;url=/login/");
    exit() ;
    }    
    
     if(
trim($wachtwoord) == '')
     {
        echo 
"<font color='red'>Vul geldige wachtwoord in!</font><br>";
        
header("refresh:5;url=/login/");
    exit() ;
    } 
     
     
    
$db = new PDO('mssql:host=localhost\snelstart;dbname=SluisWWW','test','********'); 
    
    
$db->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
    
    
$stmt $db->prepare("EXECUTE spMagInvoeren ?,?,?,?,?,?,?");
     
    
$stmt->bindValue(,$usernamePDO::PARAM_STR);
    
$stmt->bindValue(,$wachtwoord);
    
$stmt->bindValue(,$ip);
    
$stmt->bindValue(,$computernaam);
    
$stmt->bindValue(,$sessieid);
    
$stmt->bindParam(,$poging);
    
$stmt->bindParam(,$relatieid);

    
$stmt->execute(); 

 print 
"<br/>Returned: $relatieid<br/><br/>\r\n";
 


 

    {
        
setcookie("TestCookie"$username);
        
// redirecten
        
exit();
    }
    
    
}