Gracias por la respuesta cucufate, ahora he encontrado esto en desarrolloweb:
Código PHP:
$fecha_ingles = $fecha;
$traducir_fecha = explode("-",$fecha_ingles);
$fecha_espaniol = $traducir_fecha[2]." / ".$traducir_fecha[1]." / ".$traducir_fecha[0];
Y va perfecto, aquí el código completo:
Código PHP:
<?php
if(isset($_POST['ref']) && !empty($_POST['ref'])) {
include "conexion.php";
echo 'Conectado';
$consulta = "SELECT fecha FROM `tabla` WHERE `ref` = {$_POST['ref']}";
$resultado = mysql_query($consulta) or die('No ha habido resultados;: ' . mysql_error());
while ($linea = mysql_fetch_array($resultado, MYSQL_ASSOC))
foreach ($linea as $fecha)
$fecha_ingles = $fecha;
$traducir_fecha = explode("-",$fecha_ingles);
$fecha_espaniol = $traducir_fecha[2]." / ".$traducir_fecha[1]." / ".$traducir_fecha[0];
echo "<table border='0' width='100%' id='table1' cellspacing='5' cellpadding='0'>
<tr>
<td bgcolor='#FFFFCC' align='left' width='152'><b>Fecha Nacimiento:</b></td><td>$fecha</td>
</tr></table>";
mysql_free_result($resultado);
mysql_close($enlace);
} else {
echo "Error, no ha introducido todos los datos";
Saludos