MySQL server version for the right syntax to use near 'Array' at line 1on query MySQL server version for the right syntax to use near 'Array' at line 1on query
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

MySQL server version for the right syntax to use near 'Array' at line 1on query

Started by ojmolina, July 19, 2005, 07:55:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ojmolina

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'



tonegolf71

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  :\'(

tonegolf71

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!