如何在php中使用prepare语句关闭连接?

时间:2015-07-08 05:53:37

标签: php mysql sql prepared-statement php-5.3

我正在使用php在服务器数据库上创建用户帐户。我使用了prepare语句来创建用户帐户。我想知道如何使用prepare语句关闭我的sql连接,或者我不需要关闭连接?是自动完成的。

这是我的代码

$(document).bind("click", "#zoomPicture", function(e) {
  console.log(e.pageX);
  console.log(e.pageY);
});

我是php的新手,所以我对此一无所知。

2 个答案:

答案 0 :(得分:2)

$ stmt->关闭();

就够了。

检查一下 http://www.w3schools.com/php/php_mysql_prepared_statements.asp

答案 1 :(得分:0)

$stmt->close(); // Closes the prepared statement

$this->conn->close(); // Closes the mysql connection