Hi there,

Im trying to echo a number from my database and trying to show on page.
This is a test page I wa trying it on:
PHP Code:
<?php include("function.php"); ?>

<?php 

        $myUser 
$_SESSION["user"];

        
$myPoints mysqli_query($con"SELECT points FROM balances WHERE userId = '$myUser'");
        
$row mysqli_fetch_array($myPoints);
        
$tempScore $row['points'];


        
?>
        
        points here..<?php   echo $tempScore;   ?>......here
Here is the function file:

PHP Code:
<?php 
$con 
mysqli_connect("localhost""db""password""user_db"); 
init($con);

function 
init($con){

    
    
session_start();
    if (isset(
$_SESSION['active']) != true) {
        
$_SESSION['active'] = true;
    } 
    
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
    
    if(isset(
$_GET['logout'])){
        
session_destroy();
        
header'Location: /index.php' ) ;
    
    }    
    
    if (
mysqli_connect_errno())
      {
        echo 
mysqli_connect_error();
        exit();
      }
$result =  mysqli_query($con"SELECT name, email, url FROM admin LIMIT 1");
$row mysqli_fetch_array($result);

 
$adminEmail $row['email'];
 
$siteUrl $row['url'];
 
$siteName $row['name'];
}

if(!isset(
$_SESSION["ref"])){
        if(isset(
$_GET["ref"])){
        
$_SESSION["ref"] =     mysqli_real_escape_string($con$_GET["ref"]);
        } else {
        
$_SESSION["ref"] = "";    
        }
    
    } else {
    if(isset(
$_GET["ref"])){
        
$_SESSION["ref"] =     mysqli_real_escape_string($con$_GET["ref"]);
        }    
    }

?>
Its not showing any errors or numbers at all when page is loaded.
What might be wrong with it?

Chad