[eluser]Sumon[/eluser]
would you please try with
Code:
$this->db->where('name', '$_POST['name']');
EDIT: add this line before if condition and check the value is correct or not
Code:
echo $query->num_rows();
if ($query->num_rows() > 0) //if it was found in wines.name
.......................other codes................