mysqli扩充

WBOY
Release: 2016-06-13 11:39:58
Original
790 people have browsed it

mysqli扩展

<br />$conn = new mysqli('localhost','root','123','zx','3306');<br /><br />if (mysqli_connect_errno()) {<br />    printf("Connect failed: %s\n", mysqli_connect_error());<br />    exit();<br />}<br /><br /><br />$prepare = $conn -> prepare("INSERT INTO  test  (uid,name) VALUES('?','?')");<br /><br />$num = 12;<br /><br />$hanzi = "xiha";<br /><br />$prepare -> bind_param('is',$num,$hanzi);<br /><br /><br /><br />$prepare -> execute();<br /><br /><br />
Copy after login


test表字段,uid int(11) name varchar(30)

Warning: mysqli_stmt::bind_param() [function.mysqli-stmt-bind-param]: Number of variables doesn't match number of parameters in prepared statement in 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!