Post by manyavaansh » Sun Dec 31, 2017 8:15 pm

I had a new website with lots of categories but not products yet. I messed up opencart 3.x upgrade from 2.3.0.2, so I decided to do a fresh install 2.3.0.2 and import the backup. But now I am facing following error -

Fatal error: in /home1/manyavaansh/public_html/try/system/library/db/mysqli.php on line 40

any fix? I just want my categories back, nothing else!

Newbie

Posts

Joined
Tue Feb 21, 2017 1:42 am

Post by straightlight » Sun Dec 31, 2017 9:26 pm

Fatal error: in /home1/manyavaansh/public_html/try/system/library/db/mysqli.php on line 40
More information would be needed. Could you post the most recent access / error logs from your webserver?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by manyavaansh » Mon Jan 01, 2018 10:31 pm

I am not getting any error in error log. Please let me know should there be database name and password in system/library/db/mysqli.php

My actual file on server is :
<?php
namespace DB;
final class MySQLi {
private $connection;

public function __construct($hostname, $username, $password, $database, $port = '3306') {
$this->connection = new \mysqli($hostname, $username, $password, $database, $port);

if ($this->connection->connect_error) {
throw new \Exception('Error: ' . $this->connection->error . '<br />Error No: ' . $this->connection->errno);
}

$this->connection->set_charset("utf8");
$this->connection->query("SET SQL_MODE = ''");
}

public function query($sql) {
$query = $this->connection->query($sql);

if (!$this->connection->errno) {
if ($query instanceof \mysqli_result) {
$data = array();

while ($row = $query->fetch_assoc()) {
$data[] = $row;
}

$result = new \stdClass();
$result->num_rows = $query->num_rows;
$result->row = isset($data[0]) ? $data[0] : array();
$result->rows = $data;

$query->close();

return $result;
} else {
return true;
}
} else {
throw new \Exception('Error: ' . $this->connection->error . '<br />Error No: ' . $this->connection->errno . '<br />' . $sql);
}
}

public function escape($value) {
return $this->connection->real_escape_string($value);
}

public function countAffected() {
return $this->connection->affected_rows;
}

public function getLastId() {
return $this->connection->insert_id;
}

public function connected() {
return $this->connection->ping();
}

public function __destruct() {
$this->connection->close();
}
}

Newbie

Posts

Joined
Tue Feb 21, 2017 1:42 am

Post by straightlight » Mon Jan 01, 2018 10:36 pm

The error is not from the library itself. It is generated from this library but the error itself is not the issue. Please verify your access logs either from your root FTP location of your domain or from your host error logs console.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by manyavaansh » Mon Jan 01, 2018 11:31 pm

Its very confusing.. Just let me know is there any way to import just categories on a fresh 3.x install (from the backup taken from 2.3.0.2)?

Newbie

Posts

Joined
Tue Feb 21, 2017 1:42 am

Post by straightlight » Mon Jan 01, 2018 11:34 pm

There are many ways to import your categories into your database and provided from the marketplace even for free. Although, it would be highly recommended to resolve the database error message you reported about before importing any additional data into the database. As suggested on the above, since no confusions are involved from my previous suggestion, in order to assist you with accurate solution, please verify the access logs since this issue is mainly about an upgrade.

An alternative solution would be to restore backups and to seek for professional assistance to properly upgrade your store.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: georgefeichter and 45 guests