Código PHP :
require "conf.inc.php";
$numComments = 2;
$NumLow = 0;
$sql = 'SELECT * FROM `' . $table . '`';
$allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$numallComments = mysql_num_rows($allComments);
// Fetch page-wise comments from database table
$sql .= ' ORDER BY `time` DESC LIMIT ' . $NumLow . ', ' . $numComments;
$fewComments = mysql_query($sql, $DBConn) or die("error 123: " . mysql_error());
$numfewComments = mysql_num_rows($fewComments);
while ($array = mysql_fetch_array($fewComments)) {
$titulo_noticia = mysql_result($fewComments, $i, 'titulo_noticia');
$fuente = mysql_result($fewComments, $i, 'fuente');
$noticia = mysql_result($fewComments, $i, 'noticia');
$time = mysql_result($fewComments, $i, 'time');
echo '<div class="sidebar"><h3><p align="center"> Noticias GBelectronics </p></h3><h3>'$titulo_noticia'</h3><h5>'$time'</h5><p>'$noticia'</p><ul><li>'$fuente'</li></ul></div>';
$i++;
} y en html tengo puesto esto:
Código HTML :
<div id="sidebar_container">
<?php include("noticias/GuestBook.php"); ?>
</div> esta es la parte que estoy cambiando para que me funcione:
Código PHP :
print ('<div class="sidebar">)''<h3>' . $titulo_noticia . '</h3><h5>' . $time . '</h5><p>' . $noticia . '</p><ul><li>' . $fuente . '</li></ul></div>'; Este es el error que me figura: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\AppServ\www\noticias\GuestBook.php on line 21
Alguien me ayuda saludos
