Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/01/2013, 09:00
Avatar de laureano59
laureano59
 
Fecha de Ingreso: febrero-2005
Mensajes: 395
Antigüedad: 19 años, 3 meses
Puntos: 1
Respuesta: Problema con Funcion PHP

Te voy aponer toda la aplicación, al no usar funciones me funciona bien, pero necesito hacerla en una función:

Este es el código:


Código PHP:
<html>
<head>
</head>

<body>

<p>
  <?php require_once('../Con/conex.php'); ?>
  <?php


function codigo($cont) {

mysql_select_db($database_conexinmo$conexinmo);

 
$query_ID_INMUEBLE "SELECT MAX(ID_INM)AS ID_INM FROM INMUEBLE";
        
$ID_INMUEBLE mysql_query($query_ID_INMUEBLE$conexinmo) or die(mysql_error());
        
$row_ID_INMUEBLE mysql_fetch_assoc($ID_INMUEBLE);
        
$totalRows_ID_INMUEBLE mysql_num_rows($ID_INMUEBLE);

            return 
$row_ID_INMUEBLE['ID_INM']+ $cont;          
            
            
mysql_free_result($ID_INMUEBLE);
            
//return $codigoinmueble+$cont;
            
        
}
        
?>
</p>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
  <tr>
    <td width="15%">Codigo</td>
    <td width="85%"><?php echo codigo(1);?></td>
  </tr>
</table>

</body>
</html>
__________________
http://www.weblaum.com
Laureano Melo Medina
:arriba: