mysqli_connect and unknown dataase

I am making a form to add information to a database. This is basic for learning. My problem right now is when I try to access the form through wamp. It is saying that mysqli_connect is unable to access the database because the database is unknown. The problem is on line 101 which is:

$connect = mysqli_connect($host, $user, $pw, $db) or die(mysqli_error());

Not sure if I did anything wrong, but I am not seeing the problem.

Update: I am also receiving a mysqli_error also. It states that I have no parameters.

Is mysqli compiled on our server ?
look in your phpinfo

The strangest thing, I can’t find php.ini

I found a php.xml, would this be php.ini?

Never mind the previous question about php.ini I found it. I have php version 5.4.3 which is suppose to automatically enable mysqli.

Ok, I looked in php.ini and extension=php_mysqli.dll is without ; I am assuming this means that the mysqli is running.

Finally I noticed after looking that I dont have mysqli compiled. Sorry for all the previous rambling.

Make a new text file call it info.php and put this code in it.
Then go to that file and read it see whats enabled.

[php]<?php
phpinfo();
?>[/php]

Noodle, I have read that and found mysqli there. the client API library version is 5.0.10. allow_local_infile is on on both local value and master value. The same for allow_persistent. There is no default value or local or master. default port is 3306. Should that be the same is wamp server? default_pw, default_socket, default_user have no value. Unlimited for max_links and ma_persistent, and reconnect is off.

I am so goofy. I figured it out. Wile I was trying to figure out why wamp wasn’t working earlier, I uninstalled it and then re-installed it. The thing I forgot was the database I created was gone, so mysqli_connect was looking for a non- existing DB. Geesh, the old noggin is slowly cranking up. LOL

Sponsor our Newsletter | Privacy Policy | Terms of Service