Post by jdnorup » Fri Dec 06, 2019 12:11 pm

Hi
I am trying to update from 1.5.6.4 version to 3.0.3.2
I am getting this error message

Unknown: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/carrepa1/public_html/shop/system/library/db/mysql.php on line 7

Progress
SyntaxError: Unexpected token < in JSON at position 0 OK Unknown: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/carrepa1/public_html/shop/system/library/db/mysql.php on line 7{"success":"Patch 1000 has been applied (1 of 10)","next":"index.php?route=upgrade\/upgrade\/next&step=2"}


Below is the code for the file in question

<?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();
}
}


I have tried to read some other posts with similar problems with no luck. I am hoping someone can help me with this problem.

Thanks
Jamie

Newbie

Posts

Joined
Sun Jun 05, 2016 10:45 am

Post by xxvirusxx » Fri Dec 06, 2019 3:06 pm

Upgrade step by step....

1.5.x to 2.1.x
2..1x to 2.3.x
2.3.x to 3.0.x

If not, search how to change MYSQLI in 1.5.6.4 then try to upgrade to 3.0.3.2
viewtopic.php?t=110180#p572236

OC 2.3.0.2 | OC 3.0.3.6 | Extensions converted by me | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România
Who is online

Users browsing this forum: No registered users and 16 guests