![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
22/10/2004, 05:35
|
![Avatar de ibme74](http://static.forosdelweb.com/customavatars/avatar59355_1.gif) | | | Fecha de Ingreso: marzo-2004
Mensajes: 81
Antigüedad: 20 años, 10 meses Puntos: 0 | |
EL Codigo:
<?
$host = "";
$user = "";
$password = "";
$dbdat = "";
$link = mysql_connect ($host,$user,$password);
$query = "SELECT * from referen where codigo='50'";
$result=mysql_db_query($dbdat,$query,$link);
while ($row = mysql_fetch_array($result))
{
$CAMPO = $row[nombre];
$NUM_CAR = strlen($CAMPO);
$NUM_CAR_SHOW = 2;
if ($NUM_CAR > $NUM_CAR_SHOW) {
$resto = strlen ($CAMPO, 0, $NUM_CAR_SHOW);
echo "$resto" ;
echo "$NUM_CAR";
echo "juan";
echo "$NUM_CAR_SHOW" ;
}else{
echo "$CAMPO" ;
echo "$NUM_CAR ";
echo "pepe";
echo "$NUM_CAR_SHOW" ;
}
}
mysql_close();
?>
Me muestra 7juan2 , no me muestra $resto
Última edición por ibme74; 30/01/2007 a las 04:59 |