Welcome Guest, Not a member yet? Register   Sign In
problems with Database Forge class
#4

[eluser]chejnik[/eluser]
Hi,
problems seems to be in Forge class itself

When I comment a lot of lines it works
Code:
// --------------------------------------------------------------------

    /**
     * Add Field
     *
     * @access    public
     * @param    string    collation
     * @return    void
     */
    function add_field($field = '')
    {
    /*    if ($field == '')
        {
            show_error('Field information is required.');
        }
        
        if (is_string($field))
        {
            if ($field == 'id')
            {
                $this->fields[] = array('id' => array(
                                        'type' => 'INT',
                                        'constraint' => 9,
                                        'auto_increment' => TRUE
                                        )
                                    );                                    
                $this->add_key('id', TRUE);
            }
            else
            {
                if (strpos($field, ' ') === FALSE)
                {
                    show_error('Field information is required for that operation.');
                }
                
                $this->fields[] = $field;
            }
        }
    */    
        if (is_array($field))
        {
            $this->fields = array_merge($this->fields, $field);
        }
        
    }

I leave only if (is_array($field)) condition.
Ales


Messages In This Thread
problems with Database Forge class - by El Forum - 02-20-2008, 09:58 AM
problems with Database Forge class - by El Forum - 02-20-2008, 01:28 PM
problems with Database Forge class - by El Forum - 02-23-2008, 03:56 AM
problems with Database Forge class - by El Forum - 02-23-2008, 05:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB