I recently updated the server on which I work. I have got an error:

> 
> "Warning: array\_flip() expects parameter 1 to be array, null given in..."
> 
> 
> 

Does someone know how to fix it?

Here is a part of PHP code:

```
function redirectWrongDep($url) { 
    $deps = @getDepsByIdUrl($url); 
    $depsFlip = array_flip($deps); 
    if ($_GET['dep'] && !in_array($_GET['dep'], $depsFlip)) { header('Location:'.URL); 
        exit(); 
    } 
} 
function getDepsByIdUrl($url) { 
    $sql = "SELECT ws_flash_departement.nom,ws_flash_departement.id_departement FROM ws_flash_departement WHERE ws_flash_departement.no_resultats != 0 AND ws_flash_departement.id_departement IN (SELECT url_departement.id_departement FROM url_departement WHERE url_departement.id_url=" . $url . ") ORDER BY nom ASC"; 
    $result = mysql_query($sql); 
    while ($row = mysql_fetch_assoc($result)) { 
        $deps[$row["id_departement"]]=utf8_encode($row["nom"]); 
    } 
    mysql_free_result($result); 
    return $deps; 
 } 

```