Dejo mi solución para el ejercicio 1 de la entrega CU00842B del tutorial de programación web desde cero con PHP:
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8"/>
<meta lang="es"/>
</head>
<body>
<?php
$connect = mysqli_connect("sql302.byethost17.com","b17_18051302","****");
if($connect == 0){
echo "Error: No se pudo conectar a la BD";
}else {
mysqli_select_db ( $connect,"b17_18051302_mibasededatos" );
$tilde = $connect->query ( "SET NAMES 'utf8'" );
$table = mysqli_query ( $connect,"SELECT* FROM agenda" );
$contador = 0;
$row = mysqli_fetch_array ( $table );
while ($row != NULL ) {
if ( stripos ( $row["nombre"],"m" ) === 0 ) {
$contador ++;
}
$row = mysqli_fetch_array ( $table );
}
echo "Resultado: " . $contador;
}
mysqli_free_result($table);
mysqli_close($connect);
?>
</body>
</html>