session_start(); include_once("../../libphp/conates.php"); include_once("../../libphp/misfuns.php"); $idprofyfin = substr(strrchr(__FILE__, "-"), 1); $pospto = strpos($idprofyfin, "."); $idprof = substr($idprofyfin, 0, $pospto); if($idprof == "XXX") { header('Location: http://www.cartagena99.com/profesores-particulares-madrid'); exit; } // CONSULTA CON PDO (PREPARADA - SEGURA) $consulta = "SELECT asignaturas, Nombre, Estudios, experienciaLaboral, horariosDisponibles, fechaalta, disponible, conocido FROM profesores WHERE idProfesor = ? and visible = '1' ORDER BY RAND()"; $stmt = $pdo->prepare($consulta); $stmt->execute([$idprof]); $resultados = $stmt->fetchAll(PDO::FETCH_NUM); $total = count($resultados); if($total > 1) echo "MAS DE UN PROFESOR CON LA MISMA ID???"; if($total > 0) { $registro = $resultados[0]; // EL RESTO DEL CÓDIGO FUNCIONA IGUAL SIN MODIFICAR $registro=mysql_fetch_row($resultado); $registro0utf8=utf8_encode($registro[0]); $registro1utf8=utf8_encode($registro[1]); $registro2utf8=utf8_encode($registro[2]); $registro3utf8=utf8_encode($registro[3]); $registro4utf8=utf8_encode($registro[4]); $registro5utf8=utf8_encode($registro[5]); $fticon=iconofiletype($registro4utf8); } ?>