I am reposting your code in a much more readable format:
public function selectAction($action,$id){
switch($action){
case ('novisibol') :
$visibol= 1;
if( !$res=$this->_modelAdmin->visibleMenu($visibol,$id)){
echo 'errore nel cambio dello stato';
}else {
header ('Location: admin.php?menu');
}
break ;
case ('visibol') :
$visibol= 0 ;
if( !$res=$this->_modelAdmin->visibleMenu($visibol,$id)){
echo 'errore nel cambio dello stato';
}else {
header ('Location: admin.php?menu');
}
public function visibleMenu($id,$visibol){
if( empty($id) ) return false ;
if ($visibol > 1) return false ;
if ($visibol==0){
$this->_db->update( 'menu',array('menu_visibol'=>1),'menu_id='.$id );
}else {
$this->_db->update( 'menu',array('menu_visibol'=>0),'menu_id='. $id );
}
return true ;
}
public function update( $table, $values, $conditions = '1' ){
$first = true;
$query = "UPDATE " . $table;
$query .= " SET ";
foreach( $values as $name => $value ){
if( ! $first ){
$query .= ", ";
}
$query .= $name . " = " . $value;
$first = false;
}
$query .= " WHERE ";
$query .= $conditions;
return mysqli_query( $this->_conn, $query );
}
In what you call your 3rd class, it seems a bit off, but I am not sure. Before return mysqli_query( $this->_conn, $query ); add this before it: error_log(var_export($query,true));
When the query runs, it will post it to your error log and then you will be able to see if your query is actually doing what you want it to do.