Mysqli查询错误

I have an error in this lines:

if(isset($_POST["B1"]) && @$_SESSION["done"]!="ture") {
$select="select id from user where username='$_POST[T2]' ";
$result=mysql_query($select);
$num=mysql_num_rows($result);
@$name=$_REQUEST['T2'];
@$pas=$_REQUEST['T3'];
if(($_POST['T2']=='')||($_POST['T3']=='')) ;

I want mysqli of this codes

try this, i assumsed $conn in your variable database connection

$select="select id from user where username=".$_POST[T2];
$result=mysqli_query($conn,$select);
$num=mysqli_num_rows($result);

Notice: Undefined variable: conn in C:\Wamp\www\online libraryegister.php on line 106

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\Wamp\www\online libraryegister.php on line 106

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\Wamp\www\online libraryegister.php on line 107

my codes lines :

if(isset($_POST["B1"]) && @$_SESSION["done"]!="ture") {
$select="select id from user where username=".$_POST['T2'];
$result=mysqli_query($conn,$select);
$num=mysqli_num_rows($result);
@$name=$_REQUEST['T2'];
@$pas=$_REQUEST['T3'];
if(($_POST['T2']=='')||($_POST['T3']=='')) ;