Quantcast
Channel: BitNami Answers - latest questions
Viewing all articles
Browse latest Browse all 2052

Accessing MySQLi from php in LAMP? Or Problem understanding Display

$
0
0

I am sure this is a stupid error, but I seem stumped.

I have recently created a LAMP stack in an Amazon Instance. Everything seems to function fine, and I am able to connect to the MySQL database using mysql_connect fine. However, if I try to do the same thing with 'mysqli__connect, then all I get is a blank page. This includes any html code, etc. Here is the example of my connection in both:

mysql_connect("localhost:3306", "root", "password") or die(mysql_error());

This does not work:

$con=mysqli_connect("localhost","root","password","test","3306");
if (mysqli_connect_errno($con)) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  } else {
echo "connected";
}

I checked in php.ini and I see that ;extension=php_mysqli.dll is installed

I want to point out that I am not sure that MySQLi is NOT working: I see the page load, but then the page display is EMPTY.

THank you in advance


Viewing all articles
Browse latest Browse all 2052

Trending Articles