You are here:

PHP5/issue with sqli object in php code



I had recently asked you about an issue with using msqli objects in my php code. As far as errors generated is concerned, no such error message is generated. It's just a blank page, instead, that is being produced off the code. Also, I checked the configuration details of my PHP, and mysqli is enabled in it. Here's a screenshot of the same:

Kindly let me know what's to be done next.

PS I have also added the extension folder's directory in the php.ini file and uncommented the extension definitions for mysql and myslqi (in php.ini).

Hello Ashish,
I would recommend following the example in the mysqli quick start guide at
$mysqli = new mysqli("", "user", "password", "database");
if ($mysqli->connect_errno) {
   echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;

if (!$mysqli->query("DROP TABLE IF EXISTS test") ||
   !$mysqli->query("CREATE TABLE test(id INT)") ||
   !$mysqli->query("INSERT INTO test(id) VALUES (1)")) {
   echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error;

Try this (substituting your connection info) and you should see an indication of what is happening.


All Answers

Answers by Expert:

Ask Experts


Robert Davis


My focus in PHP has been calculations, reporting, database manipulation (MySQL), automated scripting, screen scraping, and tracking systems. A summary of my business is posted at


I've been programming in many languages for over 15 years, but the last several years I've focused on php for websites and perl for data processing. I've posted several tricks I've learned at

I have a bachelors degree and a masters degree, both in electrical engineering from Arizona State University.

©2017 All rights reserved.