Driver code
public function fullClient() {
// $information = $this->data['Cliente']['informacio'];
$client = $this->data['Cliente']['cliente'];
//$posicion_coincidencia = strrpos($cadena_de_texto, $cadena_buscada, -20);
// $this->Flash->error(__($hola));
$this->loadModel('Cliente');
if ($this->request->is('post')) {
$this->Cliente->create();
if ($this->Cliente->save($this->request->data)) {
$consult = $this->Cliente->find('all', array(
'conditions' => array('cliente LIKE ' => $client)));
$id_client = $consult[0];
$data=array('procesos_id'=>'111',
'clientes_id'=>$id_client,
'fecha' => getdate());
$this->loadModel('Necesidad');
$this->Necesidad->save($data);
$this->Flash->success(__($client.var_dump("hola")));
return $this->request->data;
}
$this->Flash->error(__('Unable to add your post.'));
}
}
The model is called Necessity.php and the table in the database is called needs, but when you try to insert the following error comes out: