Hey Donatello, Yep, I'm Italian :-)
By the way, try using a session container to verify if there actually is a double submit (I had that once). A counter will do, and you will see if it is incremented twice. I also suggest getting rid of xampp and using the internal PHP server when developing: `php -S localhost:8080 -t public public/index.php` will do. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 27 March 2014 01:33, donatello [via Zend Framework Community] < [email protected]> wrote: > THank you Marco! Are you Italian! :) I'm italian! > Yes, i'm sure not have any double submint! > > I post my code: > in userTable: > > public function saveUser(User $user) > { > $data = array( > 'email' => $user->email, > 'name' => $user->name, > //'password' => $user->password, > ); > //$id = (int)$user->id; > > > > $this->tableGateway->insert($data); > > } > > in my controller: > > public function createUser(array $data){ > > $sm = $this->getServiceLocator(); > $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); > $resultSetPrototype = new \Zend\Db\ResultSet\ResultSet(); > > $resultSetPrototype->setArrayObjectPrototype(new > \Application\Model\User); > $tableGateway = new \Zend\Db\TableGateway\TableGateway('user', > $dbAdapter, null, $resultSetPrototype); > $user = new User(); > > $user->exchangeArray($data); > $userTable = new UserTable($tableGateway); > > > > $userTable->saveUser($user); > return true; > > > } > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://zend-framework-community.634137.n4.nabble.com/Double-insert-in-the-database-with-form-in-zend-2-2-y-2-3-tp4661919p4661921.html > To start a new topic under Zend Framework, email > [email protected] > To unsubscribe from Zend Framework Community, click > here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=b2NyYW1pdXNAZ21haWwuY29tfDYzNDEzN3wxNzE0OTI1MTk4> > . > NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Double-insert-in-the-database-with-form-in-zend-2-2-y-2-3-tp4661919p4661922.html Sent from the Zend Framework mailing list archive at Nabble.com.
