Estimados estoy realizando una sección denominada "noticias" en mi web, donde la pagina principal debe tomar de php y mysql los campos e insertarlos en un div en dicha index.php principal. Estuve horas modificando, reemplazando codigo, intente de todas las maneras pero nada no se como hacerlo este es el codigo en php
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++;
}
en el html del index tengo puesto esto:
Código HTML:
<div id="sidebar_container">
<?php include("noticias/GuestBook.php"); ?>
</div>
como hago para que funcione Abrazo