The difference between mysql_errno and mysql_error

Can someone explain the difference between mysql_errno and mysql_error?

+3
source share
5 answers

mysql_errno returns the error code, and mysql_error returns the error text ...

+10
source

Are you saying php functions?

mysql_errno returns the error number,

and mysql_error returns the error text.

You can easily find the difference at http://www.php.net/manual/en/function.mysql-errno.php

+1
source
 string mysql_error  ([  resource $link_identifier  ] )

MySQL. , MySQL, . mysql_error() . , MySQL ( mysql_error() mysql_errno()), , , , MySQL.

mysql_errno -

0

mysql_error - MySQL

mysql_errno - MySQL

0

I would like to add to the topic that the MySQL-specific error numbers returned mysql_errno()are not the numbers of SQL errors that can be expected, they differ from the SQLSTATE values ​​(returned by the property mysql_sqlstate()or sqlstateinside mysqli_sql_exception). You can find a complete list of error messages and error numbers for your MySQL distribution here (in addition to the file Docs/mysqld_error.txt).

Source: MySQL Reference Guide

0
source

Source: https://habr.com/ru/post/1755701/


All Articles