03 Sep 2010 
Support Center » Knowledgebase » My osCommerce site is getting errors after the PHP5 MySQL4 upgrade
 My osCommerce site is getting errors after the PHP5 MySQL4 upgrade
Solution When doing a search in admin/customers.php you may get a similar error:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in 
/var/www/vhosts/domain.com/httpsdocs/admin/customers.php on line 763

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in 
/var/www/vhosts/domain.com/httpsdocs/admin/customers.php on line 765

This is because PHP5 handles arrays differently, they must be defined before used, or in this case, merged.

Solution:

Edit the admin/customers.php file:

Change:
line 763: $customer_info = array_merge($country, $info, $reviews);

line 765: $cInfo_array = array_merge($customers, $customer_info); 

To:
line 763: $customer_info = array_merge((array)$country, (array)$info, (array)$reviews);

line 765: $cInfo_array = array_merge((array)$customers, (array)$customer_info);


Another common error after the MySQL upgrade is:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL 
server version for the right syntax to use near '-20, 20' at line 1

These errors are produced because mysql handles negative values differently in MySQl 4.1

Solution:

Edit admin/includes/classes/split_page_results.php AND includes/classes/split_page_results.php

Change:
line 65: $offset = ($max_rows_per_page * ($current_page_number - 1));
line 66: $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
To:
line 65: $offset = ($max_rows_per_page * ($current_page_number - 1));
line 66: if ($offset < 0)  $offset = 0 ;
line 67: $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


Feel free to shoot us an email if you have any questions!


Article Details
Article ID: 69
Created On: 26 Oct 2006 12:17 AM

 This answer was helpful  This answer was not helpful

 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | News
Language:

Help Desk Software By Kayako eSupport v3.11.01