Menu

Warning in table.class.php

w0d0l0n3r
2004-10-11
2013-04-17
  • w0d0l0n3r

    w0d0l0n3r - 2004-10-11

    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

     
    • Nilesh Dosooye

      Nilesh Dosooye - 2004-10-11

      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..

       
    • w0d0l0n3r

      w0d0l0n3r - 2004-10-12

      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

       
      • Nilesh Dosooye

        Nilesh Dosooye - 2004-10-12

        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

         
    • w0d0l0n3r

      w0d0l0n3r - 2004-10-12

      Can you give me a suggestion as to how I can troubleshoot this further?

       
      • Nilesh Dosooye

        Nilesh Dosooye - 2004-10-12

        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..

         
        • w0d0l0n3r

          w0d0l0n3r - 2004-10-12

          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.

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.