Error trying to insert some data using Zend_Db_Table/PostgreSQL

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Error trying to insert some data using Zend_Db_Table/PostgreSQL

by Juan Felipe Alvarez Saldarriaga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey!

I got an error, actually I can't see it, but let me explain the situation, I'm using PostgreSQL 8.3 and I have this table:

clinic_system_platform_xref:
* clinic_id integer NOT NULL
* platform_id integer NOT NULL

Both columns are the primary key of the table:

clinic_system_platform_xref_pkey PRIMARY KEY (clinic_id, platform_id)

So what's the problem ? when I try to insert a record into this table, nothing happend, I mean not even an Exception, nothing, then the PosgreSQL crash!. I recreate the same table but I add a new column, and works perfect now, the question, is this a PDO/ZendFramework error ? maybe a bug or something ?, this is the new table structure:

clinic_system_platform_xref_test:
* clinic_system_platform_xref_id integer NOT NULL
* clinic_id integer NOT NULL
* platform_id integer NOT NULL

PRIMARY KEY: clinic_system_platform_xref_test_pkey PRIMARY KEY (clinic_system_platform_xref_id)

This is my PHP code, with this code doesn't work:

/**
 * GenericTable class.
 *
 */
class GenericTable extends Zend_Db_Table_Abstract
{
    /**
     * Class constructor
     *
     * @return void
     */
    public function __construct ( Array $arrTableInfo = array ( ) )
    {
        // loop through the table info values and set them to the class' attributes
        foreach ( $arrTableInfo as $strFieldKey => $strFieldValue )
        {
            // set it!
            $this->$strFieldKey = $strFieldValue;
        }

        parent::__construct ( array ( 'db' => Zend_Registry::get( "objDb" ) ) );
    }
}

$objClinicPlatformTable = new GenericTable( array(
        "_name" => "clinic_system_platform_xref",
        "_schema" => "schema_2"
    )
);

$objClinicPlatformTable->insert( array( "clinic_id" => $intClinicId, "platform_id" => $intPlatformId ) );

Thx for any help.

Re: Error trying to insert some data using Zend_Db_Table/PostgreSQL

by Juan Felipe Alvarez Saldarriaga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I still have the same problem, any ideas ?

, Thx.

----- Original Message -----
From: "Juan Felipe Alvarez Saldarriaga" <jfalvarez@...>
To: "fw-general" <fw-general@...>
Sent: Thursday, May 8, 2008 4:02:25 PM (GMT-0500) America/Bogota
Subject: [fw-general] Error trying to insert some data using Zend_Db_Table/PostgreSQL

Hey!

I got an error, actually I can't see it, but let me explain the situation, I'm using PostgreSQL 8.3 and I have this table:

clinic_system_platform_xref:
* clinic_id integer NOT NULL
* platform_id integer NOT NULL

Both columns are the primary key of the table:

clinic_system_platform_xref_pkey PRIMARY KEY (clinic_id, platform_id)

So what's the problem ? when I try to insert a record into this table, nothing happend, I mean not even an Exception, nothing, then the PosgreSQL crash!. I recreate the same table but I add a new column, and works perfect now, the question, is this a PDO/ZendFramework error ? maybe a bug or something ?, this is the new table structure:

clinic_system_platform_xref_test:
* clinic_system_platform_xref_id integer NOT NULL
* clinic_id integer NOT NULL
* platform_id integer NOT NULL

PRIMARY KEY: clinic_system_platform_xref_test_pkey PRIMARY KEY (clinic_system_platform_xref_id)

This is my PHP code, with this code doesn't work:

/**
 * GenericTable class.
 *
 */
class GenericTable extends Zend_Db_Table_Abstract
{
    /**
     * Class constructor
     *
     * @return void
     */
    public function __construct ( Array $arrTableInfo = array ( ) )
    {
        // loop through the table info values and set them to the class' attributes
        foreach ( $arrTableInfo as $strFieldKey => $strFieldValue )
        {
            // set it!
            $this->$strFieldKey = $strFieldValue;
        }

        parent::__construct ( array ( 'db' => Zend_Registry::get( "objDb" ) ) );
    }
}

$objClinicPlatformTable = new GenericTable( array(
        "_name" => "clinic_system_platform_xref",
        "_schema" => "schema_2"
    )
);

$objClinicPlatformTable->insert( array( "clinic_id" => $intClinicId, "platform_id" => $intPlatformId ) );

Thx for any help.