salve ragazzi , ho fatto una funzione per cercare gli user , adesso mi restituisce constantemente un errore warning questa e la funzione
Codice PHP:
function ShearchStaff($staffsearch){
    global 
$dbcore;
    
$sql "select t.*  , gs.id_groups ,gs.nome_group from tech as t  left join grouptech as gs  on  t.groupid = gs.id_groups  where t nome LIKE '%".addslashes($staffsearch)."%' or t cognome LIKE '%".addslashes($staffsearch)."%' or t username or t email LIKE '%".addslashes($staffsearch)."%' LIKE '%".addslashes($staffsearch)."%' order by t.staffid asc  ";
    
$query mysql_query($sql);
    
$result mysql_num_rows($query);
    if(
$result == 0){ return false;}
    
$result = array();
    while (
$row mysql_fetch_assoc($query)){
    
$result[] = $row;
    }
    return 
$result;

questo e l errore
codice:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\supp\includes\function_staff.php on line 30