Jump to content

mysqli_connect


ameliabob

Recommended Posts

If you just changed that ini file, you need to restart the web server for it take effect (usually). Otherwise, check for startup errors. There is another setting in the ini file to display startup errors. Maybe it can't find the extension, make sure that the DLL file exists in the extension directory.

Link to comment
Share on other sites

Some things are getting better.

 

But I am still getting the : Call to undefined function mysqli_connect().

 

The dll "php_mysqli.dll is in the ../php/php.5.4.12/ext directory dated 6/23/2013.

 

in php.ini:

Changes in RED

; display_startup_errors Default Value: On Development Value: On; Production Value: Off

; This directive allows you to enable and disable warnings which PHP will issue; if you pass a value by reference at function call time. Passing values by; reference at function call time is a deprecated feature which will be removed; from PHP at some point in the near future. The acceptable method for passing a; value by reference to a function is by declaring the reference in the functions; definition, not at call time. This directive does not disable this feature, it; only determines whether PHP will warn you about it or not. These warnings; should enabled in development environments only.; Default Value: On (Suppress warnings) Development Value: Off (Issue warnings); Production Value: Off (Issue warnings); http://php.net/allow-call-time-pass-referenceallow_call_time_pass_reference = Off

I restarted all services in wamp.

 

Nothing comes up during startup.

 

I have also tried to change the format of the command thinking that php didn't recognize the parameters hence the command.

i.e.

# $cxn = mysqli_connect("localhost","fredsmith","120p53E435") or die("Couldn't connect to database. ".mysqli_error($cxn));# $cxn = mysqli_connect("localhost","root","","rats") or die("Couldn't connect to database. ".mysqli_error($cxn));

 

where the first one has no db (it is set later)

and the second one is (gasp) root with no passwords but a db.

 

Neither work when the # is removed.

 

Also as someone else rebuilt the wamp, are the passwords reset on mysql when re-installing wamp?

 

Thanks

Edited by AmeliaBob
Link to comment
Share on other sites

The lines you show in red are supposed to be comments, those are not directives. Those indicate what the various values for the settings are in different circumstances, uncommenting those lines may cause a startup error when it tries to read php.ini. You need to change the line that has the actual setting, and set display_startup_errors to on. The allow_call_time_pass_reference setting doesn't apply to what you're doing, that would apply if you made a function call like this:

 

func(&$var);

 

 

I have also tried to change the format of the command thinking that php didn't recognize the parameters hence the command.

That's not the issue, the issue is that the function is not defined at all because the extension is not loaded. If the list of parameters was wrong then it would tell you that instead of saying the function doesn't exist.

Link to comment
Share on other sites

In my ongoing quest.

 

In php.in the line that says extension=php_mysqli.dll does not have a ';' in front of it

 

In php extensions display from the aetray php extensions both php_mysql and php_mysqli are checked

 

In aetray php/PHP Setting only displays a background behind that is backlit blue "set??" and cannot be selected.

 

Does this move the ball forward??

 

Link to comment
Share on other sites

I'm not sure what aetray is, I haven't used WAMP. If you want to find out what is actually loaded, then create a phpinfo page and it will list all options and extensions. If mysqli is not listed there, then it's not loaded. I can tell you now though that it won't be listed there, because it's saying the functions aren't defined. I would still enable startup errors so that you can figure out if PHP has startup errors loading extensions or things like that. WAMP might also have an error log that would contain error messages like that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...