Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo and suppress error on db connect. #348

Closed
wants to merge 1 commit into from
Closed

Fix typo and suppress error on db connect. #348

wants to merge 1 commit into from

Conversation

ryanpcmcquen
Copy link
Contributor

This way if the connection fails, the failure can be captured and used as intended.

This way if the connection fails, the failure can be captured and used as intended.
@dregad dregad added the mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1) label Jun 15, 2017
@dregad
Copy link
Member

dregad commented Jun 15, 2017

To my knowledge, mysqli_real_connect() returns false in case of error, which is checked just below, so I'm not sure why we'd need to suppress errors with @... Did you experience an actual problem without the error suppression operator ? If so, please share the details.

@ryanpcmcquen
Copy link
Contributor Author

Yes, without the error suppression operator I was unable to get past a warning that it created (I'm using Whoops on my API). I'll break things again to get you the exact error.

@dregad
Copy link
Member

dregad commented Jun 28, 2017

@ryanpcmcquen I would appreciate if you could provide a code snippet to reproduce the problem

@ryanpcmcquen
Copy link
Contributor Author

Sorry, I have to break our database to do it. I'll try to carve out some time this week but have been swamped.

@ryanpcmcquen
Copy link
Contributor Author

I get a timeout error without ignoring warnings (@):

 Whoops \ Exception \ ErrorException (E_WARNING)
mysqli_real_connect(): (HY000/2002): Connection timed out

screen shot 2017-06-28 at 9 43 44 am

@dregad dregad added the bug label Nov 25, 2017
@dregad dregad added this to the v5.20.10 milestone Nov 25, 2017
dregad pushed a commit that referenced this pull request Nov 25, 2017
This way if the connection fails, the error can be captured and used as
intended. Without this, mysqli_real_connect() triggers a PHP warning.

Fixes #348
@dregad
Copy link
Member

dregad commented Nov 25, 2017

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants