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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 + 30 = ?
Subscribe to this entry?

 
 [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-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 10:01:24 2020 UTC