php,mysql,session,mysqli,tinytext
You need to pass the variable as a variable to your query ad wrap your values into an "'s, example: $mysqli->query("INSERT INTO `myDatabase`.`myTable`(Date,Time,SID) VALUES ('1','2','" . $sessionID . "')"); ...
php,mysql,string,truncation,tinytext
In cases like this it's probably best to measure. If you don't notice a difference then it doesn't matter. My intuition tells me that, since your snippet size is very small and the plain text can be very big it would be better to truncate before hand. Take the performance...