Glese Posted November 27, 2011 Share Posted November 27, 2011 After I did enable the following error reporting: Default Value: E_ALL & ~E_NOTICE I am getting the error message described in the title of this thread. I do have the php_mysqli.dll extension enabled as well - AND the function used to work as is, before I changed the error reporting, thus the function actually should be defined, what could be another reason, that PHP thinks it is not a defined function? Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/ Share on other sites More sharing options...
Glese Posted November 27, 2011 Author Share Posted November 27, 2011 When restarting the Apache server I also get the error message: synatx error, unexpected '&' in .../php.ini on line 110. And line 110 is: Default Value: E_ALL & ~E_NOTICE EDIT: I am quite sure it has to do with the php.ini, I must be doing something wrong, because if I revert the error_reporting back to the default with the ; in the front, then the mysqli_connect function does work again. I only enabled the above error reporting to get rid of the notices. Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291632 Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2011 Share Posted November 27, 2011 While developing, you want all notices to be displayed so you can fix their causes. It looks like you managed to uncomment a line that is there to show you how to set it up. That line should have the semicolon at the beginning of it, to indicate it is a comment. The actual value (for developing) should simply be: error_reporting = -1 Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291649 Share on other sites More sharing options...
Glese Posted November 27, 2011 Author Share Posted November 27, 2011 I did try your suggestion as follows, I hope I did it right: ; error_reporting ; Default Value: E_ALL & ~E_NOTICE ; Development Value: E_ALL | E_STRICT ; Production Value: E_ALL & ~E_DEPRECATED error_reporting = -1 And now the mysqli function does work, but also, I am still getting notices, and it seems as if I did not adjust error_reporting at all, which means as if it is like it was in the beginning. Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291654 Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2011 Share Posted November 27, 2011 That's right. -1 is the highest level of error reporting, and will show every possible notice. As I said, you really should display them so you can fix the issues that are causing them. What notices are you trying to suppress by not displaying them? Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291656 Share on other sites More sharing options...
Glese Posted November 27, 2011 Author Share Posted November 27, 2011 This one for example: Notice: Constant DB_HOST already defined in C:\...\connectvars.php on line 2 Just for you notice, I do understand your suggestion of proper coding, though this is an older project and I am not so serious about solving the notices. Just out of curiosity what would be the sign for having the serious errors excluding notices? This one did not work for me: error_reportign = E_ALL ^ E_NOTICE And this one did not work for me as well: error_reporting = E_ALL & ~E_NOTICE Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291657 Share on other sites More sharing options...
Pikachu2000 Posted November 27, 2011 Share Posted November 27, 2011 error_reporting = E_ALL & ~E_NOTICE should be right. Restart Apache after making any changes, of course. You can verify its value with phpinfo(); That notice would be very easy to fix with !defined(), or maybe by changing a call to include to include_once, BTW. Quote Link to comment https://forums.phpfreaks.com/topic/251900-fatal-error-call-to-undefined-function-mysqli_connect/#findComment-1291660 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.