Hi during the installation of GLPI (windows) i have an error. Error: Call to a member function fetch_assoc() on boolean in C:\wamp64\www\glpi\inc\dbmysql.class.php on line 318
GLPI SETUP
Update
Successful database connection
The database version seems correct (5.7.24) - Perfect !The database version seems correct (5.7.24) - Perfect !
Update of the premises
The new structure is hierarchical
If you were using a separator character you can specify it to automate the generation of the hierarchy.
You can also specify a base location that will include all generated locations.
Separation character
Root place
( ! ) Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in C:\wamp64\www\glpi\inc\dbmysql.class.php on line 318
( ! ) Error: Call to a member function fetch_assoc() on boolean in C:\wamp64\www\glpi\inc\dbmysql.class.php on line 318
Call Stack
# Time Memory Function Location
1 0.0001 405688 {main}( ) …\update.php:0
2 0.0587 1673248 showLocationUpdateForm( ) …\update.php:579
3 0.0678 1673664 display_old_locations( ) …\update.php:384
4 0.0686 1673712 DB->fetch_assoc( ) …\update.php:227
This is a part of the script
function prepare($query) {
global $CFG_GLPI, $DEBUG_SQL, $SQL_TOTAL_REQUEST;
$res = @$this->dbh->prepare($query);
if (!$res) {
// no translation for error logs
$error = " *** MySQL prepare error:\n SQL: ".$query."\n Error: ".
$this->dbh->error."\n";
$error .= Toolbox::backtrace(false, 'DBmysql->prepare()', ['Toolbox::backtrace()']);
Toolbox::logInFile("sql-errors", $error);
if (class_exists('GlpitestSQLError')) { // For unit test
throw new GlpitestSQLError($error);
}
if (($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE)
&& $CFG_GLPI["debug_sql"]) {
$SQL_TOTAL_REQUEST++;
$DEBUG_SQL["errors"][$SQL_TOTAL_REQUEST] = $this->error();
}
}
return $res;
}
/**
* Give result from a sql result
*
* @param mysqli_result $result MySQL result handler
* @param int $i Row offset to give
* @param type $field Field to give
*
* @return mixed Value of the Row $i and the Field $field of the Mysql $result
*/
function result($result, $i, $field) {
if ($result && ($result->data_seek($i))
&& ($data = $result->fetch_array())
&& isset($data[$field])) {
return $data[$field];
}
return null;
}
/**
* Number of rows
*
* @param mysqli_result $result MySQL result handler
*
* @return integer number of rows
*/
function numrows($result) {
return $result->num_rows;
}
/**
* Fetch array of the next row of a Mysql query
* Please prefer fetch_row or fetch_assoc
*
* @param mysqli_result $result MySQL result handler
*
* @return string[]|null array results
*/
function fetch_array($result) {
return $result->fetch_array();
}
/**
* Fetch row of the next row of a Mysql query
*
* @param mysqli_result $result MySQL result handler
*
* @return mixed|null result row
*/
function fetch_row($result) {
return $result->fetch_row();
}
/**
* Fetch assoc of the next row of a Mysql query
*
* @param mysqli_result $result MySQL result handler
*
* @return string[]|null result associative array
*/
line 318 - function fetch_assoc($result) {
return $result->fetch_assoc();
}
/**
* Fetch object of the next row of an SQL query
*
* @param mysqli_result $result MySQL result handler
*
* @return object|null
*/
function fetch_object($result) {
return $result->fetch_object();
}
/**
* Move current pointer of a Mysql result to the specific row
*
* @param mysqli_result $result MySQL result handler
* @param integer $num Row to move current pointer
*
* @return boolean
*/
function data_seek($result, $num) {
return $result->data_seek($num);
}
/**
* Give ID of the last inserted item by Mysql
*
* @return mixed
*/
function insert_id() {
return $this->dbh->insert_id;
}
/**
* Give number of fields of a Mysql result
*
* @param mysqli_result $result MySQL result handler
*
* @return int number of fields
*/
function num_fields($result) {
return $result->field_count;
}
/**
* Give name of a field of a Mysql result
*
* @param mysqli_result $result MySQL result handler
* @param integer $nb ID of the field
*
* @return string name of the field
*/
function field_name($result, $nb) {
$finfo = $result->fetch_fields();
return $finfo[$nb]->name;
}
/**
* List tables in database
*
* @param string $table table name condition (glpi_% as default to retrieve only glpi tables)
*
* @return mysqli_result list of tables
*
* @deprecated 9.3
*/
function list_tables($table = "glpi_%") {
Toolbox::deprecated('list_tables is deprecated, use listTables');
return $this->query(
"SELECT TABLE_NAME FROM information_schema.`TABLES`
WHERE TABLE_SCHEMA = '{$this->dbdefault}'
AND TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME LIKE '$table'"
);
}
/**
* List tables in database
*
* @param string $table Table name condition (glpi_% as default to retrieve only glpi tables)
* @param array $where Where clause to append
*
* @return DBmysqlIterator
*/
function listTables($table = 'glpi_%', array $where = []) {
$iterator = $this->request([
'SELECT' => 'TABLE_NAME',
'FROM' => 'information_schema.TABLES',
'WHERE' => [
'TABLE_SCHEMA' => $this->dbdefault,
'TABLE_TYPE' => 'BASE TABLE',
'TABLE_NAME' => ['LIKE', $table]
] + $where
]);
return $iterator;
}
public function getMyIsamTables() {
$iterator = $this->listTables('glpi_%', ['engine' => 'MyIsam']);
return $iterator;
}
/**
* List fields of a table
*
* @param string $table Table name condition
* @param boolean $usecache If use field list cache (default true)
*
* @return mixed list of fields
*/
function list_fields($table, $usecache = true) {
static $cache = [];
if (!$this->cache_disabled && $usecache && isset($cache[$table])) {
return $cache[$table];
}
$result = $this->query("SHOW COLUMNS FROM `$table`");
if ($result) {
if ($this->numrows($result) > 0) {
$cache[$table] = [];
while ($data = $result->fetch_assoc()) {
$cache[$table][$data["Field"]] = $data;
}
return $cache[$table];
}
return [];
}
return false;