Ver Mensaje Individual
  #24 (permalink)  
Antiguo 28/05/2009, 15:39
visona
 
Fecha de Ingreso: febrero-2008
Mensajes: 675
Antigüedad: 16 años, 3 meses
Puntos: 5
Respuesta: Saber cuantos años

si lo puse tal como tu me lo pusiste te copio el codigo entero para que lo veas
<?php require_once('../Connections/quedada.php'); ?>


<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}


mysql_select_db($database_quedada, $quedada);
$query_Recordset1 = "SELECT dia_nac, mes_naci, ano_naci FROM usuarios";
$Recordset1 = mysql_query($query_Recordset1, $quedada) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$yearComboBox = $row_Recordset1["ano_naci"];
$mesComboBox = $row_Recordset1["mes_naci"];
$yearOfPerson = date("Ym")-(int)($yearComboBox.$mesComboBox);
echo $yearOfPerson;
?>