April 30, 2012

php display blank and error on mysqli_fetch_array

Question by raindrop

I receive a blank page when I try connect to mysql, based on the error. php doesn’t like the 3rd line

$link = "SELECT * FROM `Table` WHERE `id`='$id'";
$results = mysqli_query($db,$link);
$qdata = mysqli_fetch_array($results);

This code is working on my old server, so mysqli_fetch_array seems absolute? Or did I miss something else on my php config?

Thanks!

This is the error message
Fatal error: Call to undefined function mysqli_connect() in /opt/php_script/connect.php on line 14

Line 14 is

$link = "SELECT * FROM `Table` WHERE `id`='$id'";

Answer by Starx

Your mysqli extendion is not enabled. Check your php.ini, go to the extensions part and enable it.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!