I want to create a session and write the PHPSESSID in my db when the user enters my site. The script writes info to the db but just not the PHPSESSID why not .
<?php
session_start();
session_register($PHPSESSID); // FIRST LINES OF CODE ON PAGE
$Host = "localhost";
$User = "username";
$Password = "password";
$DBName = "dbname";
$TableName = "cart";
$Link = mysql_connect ($Host, $User, $Password) or die ("The database connection could not be established!");
$query = "INSERT INTO $TableName (PHPSESSID) values ('$PHPSESSID')";
$Result = mysql_db_query ($DBName, $query, $Link);
?>