Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. An error has ocurried Unknown field :picture

An error has ocurried Unknown field :picture

Scheduled Pinned Locked Moved Support
7 Posts 2 Posters 109 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D
    Davidin
    wrote on last edited by
    #1

    After configuring the visual phonebook in the paragraph : Configuring Visual phonebook,the error continued.

    ((((my MYSQL root password is 'root')))

    [root@centos init.d]# service mysqld start
    Iniciando MySQL: [ OK ]

    [root@centos fop2]# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 5
    Server version: 5.0.77 Source distribution

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | fop2 |
    | mysql |
    | test |
    +--------------------+
    4 rows in set (0.01 sec)

    mysql> use fop2
    Database changed

    mysql> show tables;
    Empty set (0.00 sec)

    [root@centos fop2]# mysql -u root -proot < mysql.db

    mysql> GRANT ALL on fop2.* TO fop2@localhost IDENTIFIED BY 'root';
    Query OK, 0 rows affected (0.00 sec)

    mysql> exit
    Bye.

    [root@centos fop2]# service fop2 restart
    Shutting dows Flash Operator Panel 2: [ OK ]
    Starting Flash Operator Panel 2: [ OK ]


    config.php

    <?
    // Database connection details
    $DBHOST = 'localhost';
    $DBNAME = 'fop2';
    $DBUSER = 'fop2';
    $DBPASS = 'root';

    $language="en";



    1 Reply Last reply
    0
    • T
      T
      Thomas
      wrote on last edited by
      #2

      Log-in to mysql and then

      use fop2;
      select * from visual_phonebook;
      

      do you see the picture column?

      also goto

      /var/www/html/fop2/
      

      edit config.php

      Change

      define('DEBUG',false);
      

      to

      define('DEBUG',true);
      

      save and upload, goto http://YOUR_SERVER_IP/fop2/phonebook.php
      and paste the output here

      1 Reply Last reply
      0
      • D
        D
        Davidin
        wrote on last edited by
        #3

        mysql> use fop2;
        Database changed
        mysql> select * from visual_phonebook;
        ERROR 1146 (42S02):Table 'fop2.visual_phonebook' doesn´t exist

        2)edit config.php

        notice
        /var/www/html/fop2/lib/dblib.php (line 233)

        mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
        notice
        /var/www/html/fop2/lib/dblib.php (line 233)

        mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

        An error has occurred

        Unknown field: picture
        notice
        /var/www/html/fop2/lib/dblib.php (line 344)

        mysql_num_fields(): supplied argument is not a valid MySQL result resource
        notice
        /var/www/html/fop2/lib/dblib.php (line 333)

        mysql_num_rows(): supplied argument is not a valid MySQL result resource

        No records found
        notice
        /var/www/html/fop2/lib/dblib.php (line 244)

        mysql_fetch_row(): supplied argument is not a valid MySQL result resource

        1 Reply Last reply
        0
        • T
          T
          Thomas
          wrote on last edited by
          #4

          Hows about

          mysql -u root -proot
          use fop2;
          

          copy all and paste to console screen

          CREATE TABLE `visual_phonebook` (
            `id` int(11) NOT NULL auto_increment,
            `firstname` varchar(50) default NULL,
            `lastname` varchar(50) default NULL,
            `company` varchar(100) default NULL,
            `phone1` varchar(25) default NULL,
            `phone2` varchar(25) default NULL,
            `picture` varchar(100) default NULL,
            PRIMARY KEY  (`id`)
          ) ENGINE=MyISAM;
          

          and then

          show columns from visual_phonebook;
          +-----------+--------------+------+-----+---------+----------------+
          | Field     | Type         | Null | Key | Default | Extra          |
          +-----------+--------------+------+-----+---------+----------------+
          | id        | int(11)      | NO   | PRI | NULL    | auto_increment |
          | firstname | varchar(50)  | YES  |     | NULL    |                |
          | lastname  | varchar(50)  | YES  |     | NULL    |                |
          | company   | varchar(100) | YES  |     | NULL    |                |
          | phone1    | varchar(25)  | YES  |     | NULL    |                |
          | phone2    | varchar(25)  | YES  |     | NULL    |                |
          | picture   | varchar(100) | YES  |     | NULL    |                |
          +-----------+--------------+------+-----+---------+----------------+
          7 rows in set (0.00 sec)
          

          for testing

          insert into visual_phonebook(firstname, lastname, phone1) values('john', 'doe', '0141123456');
          select * from visual_phonebook;
          +----+-----------+----------+---------+------------+--------+---------+
          | id | firstname | lastname | company | phone1     | phone2 | picture |
          +----+-----------+----------+---------+------------+--------+---------+
          |  1 | john      | doe      | NULL    | 0141123456 | NULL   | NULL    |
          +----+-----------+----------+---------+------------+--------+---------+
          1 row in set (0.00 sec)
          
          
          1 Reply Last reply
          0
          • D
            D
            Davidin
            wrote on last edited by
            #5

            Ok Thanks!!!

            But not everything is correct.
            This error has not been solved.

            notice
            /var/www/html/fop2/lib/dblib.php (line 233)

            mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource


            dblib.php

            /**
             * Fetch results by associative array
             *
             * @param mixed $query Select query or database result
             * @return array Row
             */
            public function fetch_assoc($query = false) {
                $this->res_type($query);
                return mysql_fetch_assoc($query);  <<<<<<<<----------LINE 233
            }
            

            1 Reply Last reply
            0
            • T
              T
              Thomas
              wrote on last edited by
              #6

              I suppose you could do something like

              public function fetch_assoc($query = false) {
                      $this->res_type($query);
              	 if($query and !is_bool($query)) { 
                		return mysql_fetch_assoc($query); 
              	 } 
               }
              

              But my PHP isn't very good so if Nicolas could confirm that this isn't going to bork anything 😄

              1 Reply Last reply
              0
              • D
                D
                Davidin
                wrote on last edited by
                #7

                OKKKKKK !!!!! tHANKS tHOMAS.Error solved.

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                Powered by NodeBB Contributors
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups