php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74578 Sample code error
Submitted: 2017-05-12 07:41 UTC Modified: 2017-05-12 07:48 UTC
From: cnlyzy at qq dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.1.5 OS: windows10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cnlyzy at qq dot com
New email:
PHP Version: OS:

 

 [2017-05-12 07:41 UTC] cnlyzy at qq dot com
Description:
------------
---
From manual page: http://www.php.net/class.mysqli-sql-exception
---

$e->errorMessage(); in the sample code; does not exist

Test script:
---------------
<?php
mysqli_report(MYSQLI_REPORT_STRICT);
try {
    $mysqli = new mysqli('127.0.0.1','uesr','password','testDB');
    echo 'connect success';
} catch (Exception $e) {
    echo 'ERROR:'.$e->getMessage();
}

Expected result:
----------------
Capture the exception of mysqli

Actual result:
--------------
Capture the exception of mysqli

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-12 07:48 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2017-05-12 07:48 UTC] peehaa@php.net
The only sample code that uses that is a user supplied note and *not* in the actual manual.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC