bueno el día de hoy, necesito un pequeño empujoncito, ya no es como antes, que no sabía nada de nada... poco a poco, estoy empezando a progamar mis propias cosas, y como muchas empeze con mi sistema de noticias el cual problema con dos archivos noticias.php y leer.php
un día de estos me pregunte, se podra hacer todo en un archivo y pensando dije, claro con if($ver=="n"){
el problema es el siguiente:
yo, intente de esta forma y quedo espectacular :lol: pero se dio el siguiente dilema... me abre... http://jony.gratishost.com/noticias2.php
me muestra el texto de fecha. el otro punto que al hacer click en alguna noticia me vuelve a mostrar la parte de las ultimas noticias agregadas, mas la noticia, y eso no quiero que sea asi...
bueno, tengo varios problemillas
![ojotes](http://static.forosdelweb.com/fdwtheme/images/smilies/ojotes.png)
si me ayudan a optimizar un poco el codigo, aca les dejo para que ver...
Código PHP:
<?php
include("conexion.php");
$sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT 0,4";
$conectar = mysql_query($sql);
while ($row = mysql_fetch_array($conectar)) {
echo"<table cellspacing=\"0\" cellpadding=\"0\" width=\"460\" border=\"0\" align=\"center\">
<tr valign=\"top\">
<td valign=\"top\" align=\"left\">
<table align=\"left\">
<tr>
<td width=\"78\"> <img height=\"61\" src='".$row["imagen"]."' width=\"78\" border=\"0\" alt=\"noticias\" />
</td>
</tr>
</table>
<a href='$PHP_SELF?ver=n&id=".$row["id"]."'><font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\"><b>".$row["titulo"]."</b></font><font color=\"#000000\"></font></a>
<font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\">Leido: <b>".$row["lec"]."</b></font><br />
<font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\">
".$row["noticia"]."
</font>
</td>
</tr>
</table>";
echo"<br />";
}
if($ver=="n"){
$result = mysql_query("SELECT * FROM noticias WHERE id='$id'");
if($row = mysql_fetch_array($result))
$id=$row["id"];
$lec=$row["lec"];
$lec++;
$update = "UPDATE noticias SET lec='$lec' WHERE id='$id' LIMIT 1";
$updatesql = mysql_query($update);
}
echo "<table width='500' border='0' cellspacing='2' cellpadding='1' align='center'>
<tr valign='top'>
<td><b><font color='#999900' face='tahoma, Arial, verdana' size='2'>".$row["titulo"]."</font></b></td>
<td width='150'><font color='#000000' face='tahoma, Arial, verdana' size='1'>Fecha:
<b>".$row["fecha"]."</b></font></td>
</tr>
</table>
<table width='500' border='0' cellspacing='2' cellpadding='1' align='center'>
<tr>
<td><font color='#000000' face='tahoma, Arial, verdana' size='1'>
".$row["noticia2"]."</font></td>
</tr>
</table>";
?>
![Pensando](http://static.forosdelweb.com/fdwtheme/images/smilies/scratchchin.gif)
![Afirmando](http://static.forosdelweb.com/fdwtheme/images/smilies/afirmar.gif)
eso
Saludos
![Adios](http://static.forosdelweb.com/fdwtheme/images/smilies/adios.gif)