<?php $connect = mysqli_connect('localhost','root','','intertrading') or die('Unale to connect'); $sql = "select * from user"; $result = mysqli_query($connect,$sql); while($row = mysqli_fetch_row($result)){ echo 'id:'.$row[0];echo '<br>'; }