Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem while upgrading to 2.3.3.2


willer2k

Recommended Posts

Hello,

I am having trouble with some user interface while using EI only.

 

I have been able to identify that the issue happens specifically while editing the database.php file in .../includes/functions/database.php

The buttons deform on the right side when I hover with a mouse (attached picture)

 

 

One of the fallowing lines is causing the issue, but what the problem is, is beyond me...

Config in database maybe?

 

Instructions from http://library.oscommerce.com/Online&en&oscom_2_3&release_notes&v2_3_3_2

includes/functions/database.php

change tep_db_connect() from:

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;

if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}

if ($$link) mysql_select_db($database);

return $$link;
}

to:

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;

if (USE_PCONNECT == 'true') {
$server = 'p:' . $server;
}

$$link = mysqli_connect($server, $username, $password, $database);

return $$link;
}

change tep_db_close() from:

function tep_db_close($link = 'db_link') {
global $$link;

return mysql_close($$link);
}

to:

function tep_db_close($link = 'db_link') {
global $$link;

return mysqli_close($$link);
}

change tep_db_query() from:

function tep_db_query($query, $link = 'db_link') {
global $$link;

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
$result_error = mysql_error();
error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}

return $result;
}

to:

function tep_db_query($query, $link = 'db_link') {
global $$link;

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}

$result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
$result_error = mysqli_error($$link);
error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}

return $result;
}

change tep_db_fetch_array() from:

function tep_db_fetch_array($db_query) {
return mysql_fetch_array($db_query, MYSQL_ASSOC);
}

to:

function tep_db_fetch_array($db_query) {
return mysqli_fetch_array($db_query, MYSQLI_ASSOC);
}

change tep_db_num_rows() from:

function tep_db_num_rows($db_query) {
return mysql_num_rows($db_query);
}

to:

function tep_db_num_rows($db_query) {
return mysqli_num_rows($db_query);
}

change tep_db_data_seek() from:

function tep_db_data_seek($db_query, $row_number) {
return mysql_data_seek($db_query, $row_number);
}

to:

function tep_db_data_seek($db_query, $row_number) {
return mysqli_data_seek($db_query, $row_number);
}

change tep_db_insert_id() from:

function tep_db_insert_id($link = 'db_link') {
global $$link;

return mysql_insert_id($$link);
}

to:

function tep_db_insert_id($link = 'db_link') {
global $$link;

return mysqli_insert_id($$link);
}

change tep_db_free_result() from:

function tep_db_free_result($db_query) {
return mysql_free_result($db_query);
}

to:

function tep_db_free_result($db_query) {
return mysqli_free_result($db_query);
}

change tep_db_fetch_fields() from:

function tep_db_fetch_fields($db_query) {
return mysql_fetch_field($db_query);
}

to:

function tep_db_fetch_fields($db_query) {
return mysqli_fetch_field($db_query);
}

change tep_db_input() from:

function tep_db_input($string, $link = 'db_link') {
global $$link;

if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($string, $$link);
} elseif (function_exists('mysql_escape_string')) {
return mysql_escape_string($string);
}

return addslashes($string);
}

to:

function tep_db_input($string, $link = 'db_link') {
global $$link;

return mysqli_real_escape_string($$link, $string);
}

at the end of the file, before the closing ?> PHP tag, add:

function tep_db_affected_rows($link = 'db_link') {
global $$link;

return mysqli_affected_rows($$link);
}

function tep_db_get_server_info($link = 'db_link') {
global $$link;

return mysqli_get_server_info($$link);
}

if ( !function_exists('mysqli_connect') ) {
define('MYSQLI_ASSOC', MYSQL_ASSOC);

function mysqli_connect($server, $username, $password, $database) {
if ( substr($server, 0, 2) == 'p:' ) {
$link = mysql_pconnect(substr($server, 2), $username, $password);
} else {
$link = mysql_connect($server, $username, $password);
}

if ( $link ) {
mysql_select_db($database, $link);
}

return $link;
}

function mysqli_close($link) {
return mysql_close($link);
}

function mysqli_query($link, $query) {
return mysql_query($query, $link);
}

function mysqli_errno($link = null) {
return mysql_errno($link);
}

function mysqli_error($link = null) {
return mysql_error($link);
}

function mysqli_fetch_array($query, $type) {
return mysql_fetch_array($query, $type);
}

function mysqli_num_rows($query) {
return mysql_num_rows($query);
}

function mysqli_data_seek($query, $offset) {
return mysql_data_seek($query, $offset);
}

function mysqli_insert_id($link) {
return mysql_insert_id($link);
}

function mysqli_free_result($query) {
return mysql_free_result($query);
}

function mysqli_fetch_field($query) {
return mysql_fetch_field($query);
}

function mysqli_real_escape_string($link, $string) {
if ( function_exists('mysql_real_escape_string') ) {
return mysql_real_escape_string($string, $link);
} elseif ( function_exists('mysql_escape_string') ) {
return mysql_escape_string($string);
}

return addslashes($string);
}

function mysqli_affected_rows($link) {
return mysql_affected_rows($link);
}

function mysqli_get_server_info($link) {
return mysql_get_server_info($link);
}
}

post-313121-0-80544700-1430445676_thumb.jpg

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...