PHP prepared statement cannot work.And I don't know what is going wrong
<p>Code below here cannot work.And I don't know where  the problem is:</p>

<pre><code> $insert_str="insert into User(Name,Password)values(?,?)";
 $stmt-&gt;$conn-&gt;prepare($insert_str);
 $stmt-&gt;bind_param("ss",$name,$password);
 $stmt-&gt;execute();
 $stmt-&gt;close();
</code></pre>

<p>I can gurantee that mysql connection and mysql configuration are ok.Because code like this works:</p>

<pre><code>$insert_str="insert into User(Name,Password)values('$name','$password')";
 $conn-&gt;query($insert_str);
 echo "Create Account Successfully";
</code></pre>

<p>Could someone help please? I have being considering potential problems for over 2 hours but nothing changed.</p>