<?php
// define variables and set to empty values

function conn($sql)
    {
    $dbhost = 'localhost';
    $dbuser = 'vinkblgn_regportal';
    $dbpass = 'Victor@007';
    $dbname = 'vinkblgn_regportal';
    
    if (!($conn = mysqli_connect($dbhost, $dbuser, $dbpass)))  {
        printf("error connecting to DB by user = $user and pwd=$pass");
        exit;
    }
    $db3=mysqli_select_db($conn,$dbname) or die("Unable to connect to local database".mysql_connect_error());

    $result = mysqli_query($conn,$sql) or die ("Can't run query because ". mysqli_error());

    return $result;
}
?>