PHP mysqli_connect_errno() 函数

PHP 教程 · 2019-01-27 17:59:35

实例

返回上一次连接错误的错误代码:

<?php $con=mysqli_connect("localhost","wrong_user","my_password","my_db"); // 检测是否连接成功 if (!$con) { die("连接失败: " . mysqli_connect_errno()); } ?>

定义和用法

mysqli_connect_errno() 函数返回上一次连接错误的错误代码。

语法

mysqli_connect_errno();

技术细节

返回值: 返回错误代码值,如果没有错误发生则返回 0。
PHP 版本: 5+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Ruby for Rails

Ruby for Rails

David Black / Manning Publications / 2006-05-11 / USD 44.95

What's Inside * How Ruby and Rails work, separately and together * Extensive Ruby language tutorial * Ruby techniques for Rails applications * Explore the Rails framework source code A new level of pr......一起来看看 《Ruby for Rails》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

在线进制转换器
在线进制转换器

各进制数互转换器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具