The line causing the error is this one...
mysql_close($con);
Here is the entirety of the code...
$con=mysqli_connect("localhost","root","pass","db_name");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM medicos");
while($row = mysqli_fetch_array($result)) {
echo '.....';
}
mysql_close($con);