欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP mysql_errno() 函數(shù)

定義和用法

mysql_errno() 函數(shù)返回上一個(gè) MySQL 操作中的錯(cuò)誤信息的數(shù)字編碼。

返回上一個(gè) MySQL 函數(shù)的錯(cuò)誤號(hào)碼,如果沒(méi)有出錯(cuò)則返回 0(零)。

語(yǔ)法

mysql_errno(connection)
參數(shù) 描述
connection 可選。規(guī)定 SQL 連接標(biāo)識(shí)符。如果未規(guī)定,則使用上一個(gè)打開(kāi)的連接。

例子

在本例中,我們將嘗試使用錯(cuò)誤的用戶名和密碼來(lái)登錄一個(gè) MySQL 服務(wù)器:

<?php
$con = mysql_connect("localhost","wrong_user","wrong_pwd");
if (!$con)
  {
  die('Could not connect: ' . mysql_errno());
  }
mysql_close($con);
?>

輸出類(lèi)似:

Could not connect: 1045