$sql = mysqli_query($connect, "SELECT * FROM `users` WHERE `id` = '1'"); if(mysqli_num_rows($sql) > 0) { $res = mysqli_fetch_array($sql); echo $res['name']; //Вывод: Петя }