+ Reply to Thread
Results 1 to 1 of 1

Thread: update curious error - urgent plzzz

  1. #1
    radub is offline Junior Member
    Join Date
    Mar 2010
    Posts
    6

    Default update curious error - urgent plzzz

    Hi,

    Am I doing something wrong here?

    Code:
    <?php
    class Model_DbTable_CoreSections extends Zend_Db_Table_Abstract{
    
    	protected $_name = 'core_sections';
    
            public function updateSection($id, $data){ 
    		
    		$where = $this->getAdapter()->quoteInto('id = ?', $id);
    		$this->update($data, $where);
    		
    	}
    }
    ?>
    I'm accesing the updateSection function in my controller where I pass it $data and $id.

    Data looks lyke this
    Code:
    $data = array(
    	'gen_user_id' 	        => $this->credidentials->id,
    	'gen_status_id' 	=> $this->formObject->getValue('status'),
    	'core_section_type_id' 	=> $this->formObject->getValue('sectionType'),
    	'label' 		=> $this->formObject->getValue('label'),
    	'created'		=> new Zend_Db_Expr('NOW()'),
    	'modified'		=> new Zend_Db_Expr('NOW()')
    );
    The $data array dump looks like this

    Code:
    Array
    (
        [gen_user_id] => 1
        [gen_status_id] => 1
        [core_section_type_id] => 2
        [label] => test plictiseala
        [created] => Zend_Db_Expr Object
            (
                [_expression:protected] => NOW()
            )
    
        [modified] => Zend_Db_Expr Object
            (
                [_expression:protected] => NOW()
            )
    
    )
    For some reason the update is not executed.

    The Zend Profiler shows me this:
    Code:
    object(Zend_Db_Profiler_Query)#92 (5) {
      ["_query":protected]=>
      string(162) "UPDATE `core_sections` SET `gen_user_id` = ?, `gen_status_id` = ?, `core_section_type_id` = ?, `label` = ?, `created` = NOW(), `modified` = NOW() WHERE (id = '6')"
      ["_queryType":protected]=>
      int(8)
      ["_startedMicrotime":protected]=>
      float(1268166988.9384)
      ["_endedMicrotime":protected]=>
      float(1268166989.0624)
      ["_boundParams":protected]=>
      array(4) {
        [1]=>
        string(1) "1"
        [2]=>
        string(1) "1"
        [3]=>
        string(1) "2"
        [4]=>
        string(16) "test plictiseala"
      }
    }
    As you can see in the profiler log in the sql the only values that appear are for created, modified and id (in WHERE clause)!
    For some reason update in my updateSection function doesn't take the $data

    Any ideas anyone?

    Thanks

    P.S. In Model_DbTable_CoreSections I have other insert and select functions which work just fine.
    Last edited by radub; 03-09-2010 at 08:04 PM.

+ Reply to Thread

Similar Threads

  1. URGENT help required
    By muneeba in forum Model-View-Controller (MVC)
    Replies: 0
    Last Post: 05-23-2010, 12:59 AM
  2. update profile and how update auth identity ??
    By forum in forum Authentication & Authorization
    Replies: 3
    Last Post: 10-26-2009, 03:40 PM
  3. Need urgent help with Zend_Form custom error messages without validator
    By Nilesh in forum General Q&A on Zend Framework
    Replies: 6
    Last Post: 03-23-2009, 04:20 PM
  4. URGENT - Controller wont load?
    By socceroos in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 02-19-2008, 06:43 PM
  5. Zf - Mvc - Error - Urgent
    By prchakal in forum General Q&A on Zend Framework
    Replies: 2
    Last Post: 02-05-2008, 03:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts