Código PHP:
Ver original
<?php require_once('Connections/hoysale.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; } GetSQLValueString($_POST['id_noticia'], "int"), GetSQLValueString($_POST['detalle'], "text")); $insertGoTo = "preguntar.php"; $insertGoTo .= $_SERVER['QUERY_STRING']; } } //NeXTenesio Special List Recordset $colname_noticias = "-1"; $colname_noticias = $_GET['id']; } $query_noticias = sprintf("SELECT * FROM noticias WHERE id = %s ORDER BY id DESC", $colname_noticias); //End NeXTenesio Special List Recordset //NeXTenesio Special List Recordset $colname_comentar = "-1"; $colname_comentar = $_GET['id']; } $query_comentar = sprintf("SELECT * FROM comentarios WHERE id_comentario = %s ORDER BY id_comentario DESC", $colname_comentar); //End NeXTenesio Special List Recordset ?> <table width="500"> <tr> <td><?php echo $row_noticias['id']; ?></td> <td><a href="comentar.php?id=<?php echo $row_noticias['id']; ?>"><?php echo $row_noticias['detalle']; ?></a></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right" valign="top">Detalle:</td> <td><textarea name="detalle" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insertar registro"></td> </tr> </table> <input type="hidden" name="id_noticia" value="<?php echo $row_noticias['id']; ?>"> <input type="hidden" name="MM_insert" value="form1"> </form> <p> </p></td> </tr> <tr> <td> </td> <td> </td> </tr> </table>
anda bien de bien. lo que quiero es es acortar la cadena
Código PHP:
que donde se muestra la noticia, o sea lo que quiero es que solo se muestre una parte de la misma y tenga un leer más.. Ver original
<?php echo $row_noticias['detalle']; ?>
gracias!!!