$con=mysqli_connect("localhost","my_user","my_password","my_db"); // ...一些 PHP 代码... mysqli_close($con); ?> 定义和用法 mysqli_close() 函数关闭先前打开的数据库连接。 语法 mysqli_close(connection); 参数描述 connection必需。规定要关闭的 MySQL 连接。 技术...
$con=mysqli_connect("localhost","my_user","my_password","my_db"); // ...一些 PHP 代码... mysqli_close($con); ?>
php $con=mysqli_connect("localhost","my_user","my_password","my_db"); // ...一些 PHP 代码... mysqli_close($con); ?> 定义和用法 mysqli_close() 函数关闭先前打开的数据库连接。 语法 mysqli_close(connection); 技术细节
$con=mysqli_connect("localhost","my_user","my_password","my_db"); if(mysqli_connect_errno()) { echo"Failed to connect to MySQL: ". mysqli_connect_error(); exit; } // ...some PHP code... mysqli_close($con); ?> ❮
}mysqli_close($con);return$ret; } 开发者ID:ciplpj,项目名称:vsm,代码行数:25,代码来源:common.inc.php 示例6: Modificar ▲点赞 1▼ functionModificar(){global$connect; $query ="UPDATE product SET name='{$_POST['name']}', price='{$_POST['price']}', stock='{$_POST['stock']}',...
当php想要破坏您的对象时,这个函数就会运行,但是您已经关闭了连接!
关闭先前打开的数据库连接: <?php $con=mysqli_connect("localhost","my_user","my_password","my_db");if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); exit; }// ...some PHP code... mysqli_close($con); ?> ❮ PHP MySQLi 函数 颜色...