|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75518 Better code examples for article "Choosing an API [to access MySQL server]"
Submitted: 2017-11-13 17:59 UTC Modified: 2019-01-01 22:29 UTC
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: codedokode at gmail dot com Assigned:
Status: Open Package: MySQL related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-11-13 17:59 UTC] codedokode at gmail dot com
The article "Choosing an API [to access MySQL server]" has incorrect code examples that can mislead users. 

First, there is no error handling. In real world examples, of course, error handling is required. For PDO, this can be solved with one line, enabling exceptions (although my personal opinion is that this mode should be teh default). But for mysqli, the error handling should be made explicitly by adding if operator after every method call. 

Also, the code examples should have at least one argument inserted via placeholders. In real world code almost all queries will have parameters and it is important to show that parameters are easier to insert using PDO.

I can correct the code examples using if this change is approved. 

I would also like to add a line "supports exceptions" to API comparison table. 


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-01 22:29 UTC]
-Package: Documentation problem +Package: MySQL related
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Oct 05 12:07:37 2022 UTC