I want to make an id obscuring into my table. I was trying to hash table = md5 or any other hashing algorithm , but how can my id hashed into my $data
array
my table look like this
depending on my id I want to send it to my hash columns, but how can I do it without doing an hidden input? add product controller
public function addProduct(){
$descripcion = $this->input->post('description');
$cost_price = $this->input->post('cost_price');
$selling_price = $this->input->post('selling_price');
$wprice = $this->input->post('wprice');
$min_stock = $this->input->post('min_stock');
$stock = $this->input->post('stock');
$max_stock = $this->input->post('max_stock');
$data = array(
'codigo' => $this->codeGenerator(4),
'descripcion' => $descripcion,
'precio_compra' => $cost_price,
'precio_venta' => $selling_price,
'precio_mayoreo' => $wprice,
'existencia_minima' => $min_stock,
'existencia' => $stock,
'existencia_maxima' => $max_stock
);
if ($data['existencia'] > $data['existencia_minima']) {
$this->json(array('min_stock' => 'el stock no puede ser mayor al min'));
}elseif ($data['existencia_maxima'] < $data['existencia']) {
$this->json(array('max_stock' => 'el stock no puede ser mayor al max'));
}else{
if (!$this->products->isExistsProduct($data)) {
$this->products->addProduct($data);
$this->json(array('msg' => 'successfully added'));
}else{
$this->json(array('duplicate' => 'product already exists'));
}
}
}
model
public function addProduct($data){
$this->db->insert('storelte_articulos',$data);
}