Hallo ich möchte gerne, dass $isOther die Anzahl der Einträge wiedergibt, die in der Spalte to_sections nicht NULL sind. In der Datenbank gibt es einen Eintrag mit to_sections 12 und einen mit to_sections NULL. Ich bekomme allerdings immer nur 0. Ich komme da nicht weiter. Kann mir jemand einen Tipp geben, woran es liegen könnte? 
$is_used wir so ausgeben: mysqli_result Object ( [current_field] => 0 [field_count] => 12 [lengths] => [num_rows] => 1 [type] => 0 )
$result_new so: mysqli_result Object ( [current_field] => 0 [field_count] => 42 [lengths] => [num_rows] => 0 [type] => 0 )
	
							
						
					$is_used wir so ausgeben: mysqli_result Object ( [current_field] => 0 [field_count] => 12 [lengths] => [num_rows] => 1 [type] => 0 )
$result_new so: mysqli_result Object ( [current_field] => 0 [field_count] => 42 [lengths] => [num_rows] => 0 [type] => 0 )
PHP Code:
	
	
$mysql_results = $this -> selectSimpleSql('sections', 'menu_area', 2, 'public_status', 2, 'menu_name', 'ASC');
  
  
 
   while($results = $mysql_results->fetch_assoc()) {
        
   $isOther = 0;
                             
   $is_used = $this ->  selectSimpleSql('orders', 'main_id', $results['id'], 'author', $_SESSION['front_user_id'], 'id', 'ASC');
         
   $result = $is_used->fetch_assoc();      
                             
   $sql = "SELECT * FROM go_hotel WHERE to_sections IS NOT NULL AND relid = '".$result['relid']."' AND 'author' = '".$_SESSION['front_user_id']."';";
    
   $result_new = $this->db->query($sql); 
                                
   $isOther = $result_new -> num_rows; 
   
       print($isOther);
   if($isOther == 0)
   $optionArr[$results['id']] = $results['menu_name']; 
        
   } 
          
							
						
Comment