请输入您要查询的百科知识:

 

词条 mysql_error
释义

正文

定义和用法

mysql_error() 函数返回上一个 MySQL 操作产生的文本错误信息。

本函数返回上一个 MySQL 函数的错误文本,如果没有出错则返回 ''(空字符串)。

语法

mysql_error(connection)

参数 描述

connection 可选。规定 SQL 连接标识符。

例子

在本例中,我们将尝试使用错误的用户名和密码来登录一个 MySQL 服务器:

<?php$con = mysql_connect("localhost","wrong_user","wrong_pwd");if (!$con) { die(mysql_error()); }mysql_close($con);?>输出类似:

Access denied for user 'wrong_user'@'localhost'(using password: YES)

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/26 7:20:31