Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Trying to update a DATE type field in mysql using Doctrine...not working
#1

[eluser]Brandt1981[/eluser]
I think that it is not passing along the single quotes that it needs with the date, but not sure.

Code:
public function update_position() {
            
   $user_id = $this->input->post('empid');
            
   $position = Doctrine::getTable('Employee_position')->find($user_id);    

              
   $position->hire_dt = $this->input->post('hiredt');

   ...

   $position->save();
            
   ...  

   $vars['position'] = Doctrine::getTable('Employee_position')->findOneByemp_id($user_id);

   ...

   $this->load->view('home', $vars);
            
}


hiredt in the post above contains the date formated like:

2010-10-20

no quotes or anything...
#2

[eluser]kaejiavo[/eluser]
Hi Brandt,

i, too encountered some problems with doctrine and datetime fields in the database, so maybe i can help you.
Please give some details:
- database field type
- doctrine field type (from your doctrine Model)
- doctrine Error message

Marco
#3

[eluser]Brandt1981[/eluser]
-date
-date
-and no doctrine error message. the database is simply receiving a blank variable, and all the dates become 000-00-00

EDIT: I figured it out, I was using find instead of findByOne* to load the array with the database information.




Theme © iAndrew 2016 - Forum software by © MyBB