Home  >  Article  >  Backend Development  >  为你详细解读PHP函数mysql_error()_PHP教程

为你详细解读PHP函数mysql_error()_PHP教程

WBOY
WBOYOriginal
2016-07-15 13:35:131048browse

在我们运用

PHP函数mysql_error()的语法格式如下:

string mysql_error ( [resource $link_identifier] )

PHP函数mysql_error()将返回上一个MySQL函数生成的错误信息,若无错误则返回一个空字符串。

使用mysql_error()函数的示例代码如下:

  1.  ?php  
  2. $connection=mysql_connect
    ("localhost","root","root") 
    or die("连接服务器失败");  
  3. mysql_select_db("mydb",$connection);  
  4. echo "错误信息:".mysql_error();  
  5. ?> 

以上就是PHP函数mysql_error()的具体使用方法。


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445929.htmlTechArticle在我们运用 PHP函数mysql_error()的语法格式如下: string mysql_error ( [resource $link_identifier] ) PHP函数mysql_error()将返回上一个MySQL函数生成的错误信...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn