At least as your code is written, you never executed the query to get a value in $t1. For that matter, you don't seem to have a connection, either.
Anyway, as written, there's no reason for $t1 to have your value. It's just a string containing a tsql query.
Not the best source, but
http://www.w3schools.com/php/php_mysql_intro.asp[
^] will help you get on your way. It has an example, a few pages in, of an insert statement.