I am trying to create my first phpCodeGenie app.
I am getting the following error:
Warning: array_keys(): The first argument should be an array in /var/www/intranet.qwertz.de/htdocs/pcg/app/generators/dbEngine/table.class.php on line 123.
I looked at line 123.
It is in the function initializeFieldsFromDb and reads:
$fieldInfoArrayKeys = array_keys($thisSQLLayerFieldInfoArray);
I seem to get this error with all pages which call the table.class.php.
Is this a problem with my php installation or my phpCodeGenie installation?
The resulting code doesnt work due to this. :^(
Thanks,
l0ner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are getting this error because the $thisSQLLayerFieldInfoArray is not an array. $thisSQLLayerFieldInfoArray is the result of the
$this->dbConn->MetaColumns($this->getTableName());
From the ADODB API, the MetaColumns is supposed to return an array. So somehow it is not returning an array for your installation.
Which system are you using? Which database? and which version of PHP?
I cant replicate it on php4/5 with mysql..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the following software versions on a Gentoo box:
mod_php 4.3.9
apache 2.0.51
mysql 4.0.20
I did a var_dump on the $thisSQLLayerFieldInfoArray and get "bool(false)" as the output. Bah!
I think I however found where the problem might be comming from.
I created a new database and one of the tables I need manually with hand typed SQL.
Strangly enough I didn't get any problems.
I checked my real database and the manual one for differences.
The difference is that when I created the production database using a GUI tool, InnoDB tables were created by default.
Are InnoDB tables supported?
-l0ner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Adodb documentation don't specifically mention anything about innoDb type tables.. but I would assume it is supported. As I have innoDb tables and my PCG version can read them and their information. So I would assume that Adodb supports innoDb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, with that script and one table, it worked fine.
I started trying all of the tables.
I found that somehow a trailing space was on a table name which is a reference table for all other tables except the one I tested first.
After fixing this, it all worked fine.
Thanks for the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to create my first phpCodeGenie app.
I am getting the following error:
Warning: array_keys(): The first argument should be an array in /var/www/intranet.qwertz.de/htdocs/pcg/app/generators/dbEngine/table.class.php on line 123.
I looked at line 123.
It is in the function initializeFieldsFromDb and reads:
$fieldInfoArrayKeys = array_keys($thisSQLLayerFieldInfoArray);
I seem to get this error with all pages which call the table.class.php.
Is this a problem with my php installation or my phpCodeGenie installation?
The resulting code doesnt work due to this. :^(
Thanks,
l0ner
You are getting this error because the $thisSQLLayerFieldInfoArray is not an array. $thisSQLLayerFieldInfoArray is the result of the
$this->dbConn->MetaColumns($this->getTableName());
From the ADODB API, the MetaColumns is supposed to return an array. So somehow it is not returning an array for your installation.
Which system are you using? Which database? and which version of PHP?
I cant replicate it on php4/5 with mysql..
Thanks for the good explaination.
I am using the following software versions on a Gentoo box:
mod_php 4.3.9
apache 2.0.51
mysql 4.0.20
I did a var_dump on the $thisSQLLayerFieldInfoArray and get "bool(false)" as the output. Bah!
I think I however found where the problem might be comming from.
I created a new database and one of the tables I need manually with hand typed SQL.
Strangly enough I didn't get any problems.
I checked my real database and the manual one for differences.
The difference is that when I created the production database using a GUI tool, InnoDB tables were created by default.
Are InnoDB tables supported?
-l0ner
Adodb documentation don't specifically mention anything about innoDb type tables.. but I would assume it is supported. As I have innoDb tables and my PCG version can read them and their information. So I would assume that Adodb supports innoDb
Can you give me a suggestion as to how I can troubleshoot this further?
just make a quick adodb script
<?
include('adodb.inc.php');
$dbConn = NewADOConnection('mysql');
$dbConn->Connect($server, $user, $pwd, $db);
$fields = $dbConn->MetaColumns("yourTable");
echo "<pre>";
print_r($fields);
echo "</pre>";
?>
this should print an array of field, if adodb is working fine for ur installation.. if not.. then there's something with adodb..
Thanks, with that script and one table, it worked fine.
I started trying all of the tables.
I found that somehow a trailing space was on a table name which is a reference table for all other tables except the one I tested first.
After fixing this, it all worked fine.
Thanks for the help.