Please help me i having this problem,
Current is my code:

error at line "if(mysql_num_rows($result)!=0)"


function getNewID($init,$field,$table)
    {
        $num = rand(1,100000000);

        $act_id = $init.$num;

        $query = "SELECT $field FROM $table WHERE $field = '$act_id'";
        $result = mysql_db_query("ssimage_db", $query);

            if(mysql_num_rows($result)!=0)
        { $exist = true; }
        else{ $exist = false; }

        while($exist)
        {
            $num = rand(1,100000000);

            $act_id = "$init".$num;

            $query = "SELECT $field FROM $table WHERE $field = '$act_id'";
            $result = mysql_db_query("ssimage_db", $query);
            if(mysql_num_rows($result)!=0)
            {
                $exist = true;
            }
            else
            {
                $exist = false;
            }
        }
        return $act_id;
    }