Jump to content
Larry Ullman's Book Forums
Kps

Mysqli_Connect Error With Php5.5.11

Recommended Posts

Hello Larry,

 

firstly thank you for your book, I have beeing programming websites for a while and I had always stayed clear of e-commerce because I was scared of it, but  a client requested some new features and thanks of your book I am finally getting over this hurdle.

 

Anyway, I was playing around with the example in your books, everything was working fine (I was testing on may apache server that run php4.7) I wanted to implement the password hashing you suggest and so I decided to upgrade my php to the latest version (5.5.11). From then on the myscl.inc.php file crashes with the message Fatal error: Call to undefined function mysqli_connect().

By comparing the php info from my 4.7 version to the current one I sea that there is a whole table titled mysqli which is not present anymore. Does this mean that this function is not supported anymore?

I have searched around on the web but haven't been able to find anything relevant (on the contrary everybody seams to suggest myslqi_connect is the way to go)

 

your help is appreciated

 

greeting

K.

Share this post


Link to post
Share on other sites

Hello, and welcome to the forums, Kps.

 

Here's the change log for PHP 5:

http://php.net/ChangeLog-5.php

 

If you search for "MySQLi", you can see all relevant changes.

Also, I'm using PHP 5.5.3, and I've had no issues at all with mysqli_connect.

 

Are you sure you didn't accidentally misspell the function name?

  • Upvote 1

Share this post


Link to post
Share on other sites

Hallo HartleySan,

 

thank you for your speedy reply.

I looked at the php change log and I see no reason why mysqli_connect should not work, yet it does not.

I am positive it is not mispelled as the same file worked fine before upgrading the php (and it works still when I revert back to 4.7.3)

 

in case here is my code:

DEFINE ('DB_HOST', 'localhost');

... (I define all the other variables)...

$dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

 

end the message is

Fatal error: Call to undefined function mysqli_connect() in C:\xampp\htdocs\ex1\ecommerce1\includes\mysql.inc.php on line 13

 

Any idea?

 

The only thing I noticed is that when I call phpinfo with version 4.7.3 I had a table titled mysqli and one titled mysqlnd that cited in the row API extension mysqli, whereas in the phpinfo for verion 5.5.11 the table mysqli is not there and in the table mysqlnd at the row API extenion it now says 'No Value', but I am at a loss to know what this all means

Should I maybe intall some additional library?

 

thanks again

k

Share this post


Link to post
Share on other sites

Perhaps the PHP 5.5 version you installed does not contain the MySQLi family of functions for some reason.

I can't imagine why, but maybe try installing PHP 5.5 from scratch again, and see what happens.

It definitely sounds like your installation is messed up.

Share this post


Link to post
Share on other sites

Hello HartleyStan,

yes. I ended up unistalling and reinstalling xampp completely and it now works.

Sorry for the inconvenience and thanks a lot for your suggestion

k

Share this post


Link to post
Share on other sites

Yes, weird things sometimes happen, and all I can imagine is that they're a result of some oversight on the devs' part.

That's why uninstalling and reinstalling generally fixes these things.

Glad it's working now.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...