coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: ojmolina on July 19, 2005, 07:55:35 PM

Title: MySQL server version for the right syntax to use near 'Array' at line 1on query
Post by: ojmolina on July 19, 2005, 07:55:35 PM
This is a clean new installation.

I created the mysql database. With the right username and password,
I run install.php
I fill all the information
When i hit "Lets Go" It says this error, leaving me in the same install.php page

• • • ERROR • • • 
The following errors were encountered and need to be corrected first:

mySQL Error: 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 'Array' at line 1on query 'Array'


Title: Re: MySQL server version for the right syntax to use near 'Array' at line 1on qu
Post by: tonegolf71 on August 13, 2005, 08:48:59 PM
I have exactly the same problem!

My server version is as follows...
Fedora Core 2
httpd     2.0.51-2.9
mysql    3.23.58-16.FC2.1
php    4.3.10-2.4

I have tried to isolate the issue and it seems to be with the "split_sql_file" function.


$sql_query = remove_remarks($sql_query);
$sql_query = split_sql_file($sql_query, ';');

foreach($sql_query as $q) {
if (!mysql_query($q)) {
$errors .= "mySQL Error: " . mysql_error() . "on query '$q'<br /><br />";
return;
}
}


When the function(split_sql_file) is called above in the install.php it is only returning the word "Array", and that is causing $q in the foreach loop just to contain the word "Array", hence the error.  ???

Can anyone help us please. Pretty please  :\'(
Title: Re: MySQL server version for the right syntax to use near 'Array' at line 1on qu
Post by: tonegolf71 on August 31, 2005, 04:31:23 PM
I've discovered that this issue is in how arrays are handled when using for..each.

If you replace the following in install.php...
if (!mysql_query($q)) {
With...
if (!mysql_query($q[0])) {
It actually fixes the install issue. HOWEVER, you walk straight into database errors in the main program.  :o

It turns out this is related to the other issue banded around the forum regarding php 4.3.10, it is in fact a bug with Zend optimizer which needs to be updated to 2.5.7.

I missed this because my server is using the Ioncube loader in php.ini, see below:

zend_extension = /usr/lib/ioncube/Ioncube_loader_lin_4.3.so

I have downloaded the next version up from this (4.4), copied to the /usr/lib/ioncube folder, and updated the /etc/php.ini.
A httpd reload later and all is well.

Whoop  ;D

Hope this helps someone!