search
Homephp教程php手册为你详细解读PHP函数mysql_error()

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

Jun 13, 2016 am 11:12 AM
errormysqlphpfunctionexistusofInterpretationdetailedgrammaruse

在我们运用

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

string mysql_error ( [resource $link_identifier] )

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

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

<ol class="dp-xml">
<li class="alt"><span><span class="tag"><span> ?php  </span></span></span></li>
<li>
<span>$</span><span class="attribute">connection</span><span>=</span><span class="attribute-value">mysql_connect<br></span><span>("localhost","root","root") <br>or die("连接服务器失败");  </span>
</li>
<li class="alt"><span>mysql_select_db("mydb",$connection);  </span></li>
<li><span>echo "错误信息:".mysql_error();  </span></li>
<li class="alt">
<span class="tag">?></span><span> </span>
</li>
</ol>

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


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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function