Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: array_merge() [function.array-merge]: Argument #1


JoeB

Recommended Posts

Hi all,

 

I had this error..

 

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /my/path/to/the/admin/customers.php on line 946 when I used a few things in the admin section after I updated my php4 to php5.

 

The reason this error is coming up is php5 does not address the function the same way it used to in php4. Not all versions may have this problem but mine did.

 

Here what I did to fix the problem.

 

In the warning it will say what line it is complaining about "line 946" in my above example.

 

Go to the file and edit it. Mine said..

$customer_info = array_merge($country, $info, $reviews);

And I changed it to this

$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);

 

Now you have to make sure that in this array_merge statement that each variable is an array. Look in the code above it and you should see something like this.

 

$country = tep_db_fetch_array($country_query);

 

So I know that $country is an array because it is being fetched as an array so I can put the (array) in front of the $country in the array_merge statement above.

 

This was changed on all of my errors and everything works fine.

 

Let me know if this was helpful and if it could be done any other way it would be great for me to know as well. I am real new at all of this.

 

Thanks to everyone that helps on this project also.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...