我使用php和ajax制作建议清单。 即使我在查询中使用关键字distinct,也不会获得不同的值

I was getting distinct values before I gave the % symbol in regular expression for searching.

Here is my code.entries.

$arr = [];
if(isset($_GET['pat']))
    $x = $_GET['pat'].'%';
else
    $x = '%';

$result = mysqli_query($con, "SELECT distinct university FROM colleges WHERE university LIKE '%".$x."%';");
while($row = mysqli_fetch_array($result))
    array_push($arr,$row['university']);

echo json_encode($arr);

How will I get distinct values? I don't want duplicates.