函数:mysql_errno()


mysql_errno

返回错误信息代码。

语法: int mysql_errno(int [link_identifier]);

返回值: 整数

函数种类: 数据库功能

内容说明

本函数可以得到 MySQL 数据库服务器的错误代码。通常用在 PHP 网页程序开发阶段,作为 PHP 与 MySQL 的除错用。

使用范例

<?php
mysql_connect
("marliesle");
echo 
mysql_errno().": ".mysql_error()."<BR>";
mysql_select_db("nonexistentdb");
echo 
mysql_errno().": ".mysql_error()."<BR>";
$conn mysql_query("SELECT * FROM nonexistenttable");
echo 
mysql_errno().": ".mysql_error()."<BR>";
?>

参考

mysql_error()  



[ 上一页 PHP 手册 下一页 ]

PHP 首页 | PHP 导读 | PHP 函数库 | PHP 函数索引 | PHP 范例程序