sistema de noticias
Olá pessoal to eu aqui denovo pedindo ajuda
bem o negocio é o seguinte to tentando montar um sistema de noticas em que aparecam as ultimas 5 noticas postadas
eu consigo mostrar elas porém não consigo organiza-las
gostaria que ficasse parecido com isto
o desenho nao ta muito bom mas ta valendo axo q da pra entender
________________________________________________________
|......................... \....$data e Hora..........................................................|
|.......................... \ ________________________________________ |
|..$Avatar..............\........$ Assunto.........................................................|
|.............................\ ........$Autor.............................................................|
------------------------------------------------------------------------------------------
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
-------------------------------------------------------------------------------------------
ai a cada notica nova trocaria no lugar das variveis
por exmplo
________________________________________________________
|......................... \....$data e Hora..........................................................|
|.......................... \ ________________________________________ |
|..$Avatar..............\........TESTE 1............................................................|
|.............................\ ........Raikm..............................................................|
------------------------------------------------------------------------------------------
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
-------------------------------------------------------------------------------------------
________________________________________________________
|......................... \....$data e Hora..........................................................|
|.......................... \ ________________________________________ |
|..$Avatar..............\........TESTE 2............................................................|
|.............................\ ........Raikm..............................................................|
------------------------------------------------------------------------------------------
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
|$TEXTO.....................................................................|
.......... $IMG.........|
-------------------------------------------------------------------------------------------
quando eu coloco pra aparecer os dados do bd aparece um na frente do outro
ai nao consigo colocar em quadros separados :unsure:
qualquer coisa se nao entender o q eu quis dizer fala ai que eu tento esplicar melhor
o codigo da pg ta ai
<?php require_once('../Connections/conectar.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_conectar, $conectar);
$query_Recordset1 = "SELECT * FROM noticias";
$Recordset1 = mysql_query($query_Recordset1, $conectar) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HOME</title>
<link rel="stylesheet" type="text/css" href="../style/home.css"/>
</head>
<body>
<div id="news"><img src="../img/post.gif" width="560" height="400" /></div>
<div id="avatar"><?php echo $row_Recordset1['avatar']; ?></div>
<div id="data"></div>
<div id="assunto"><?php echo $row_Recordset1['assunto']; ?> </div>
<div id="autor"></div>
<div id="texto" align="justify"></div>
<div id="img1"></div>
<div id="img2"></div>
<div id="img3"></div>
<div id="img4"></div>
<div id="img5"></div>
<div id="img6"></div>
<!--home1-->
<div id="news1"><img src="../img/post.gif" width="560" height="400" /></div>
<div id="avatar1"><?php echo $row_Recordset1['avatar']; ?></div>
<div id="data1"></div>
<div id="assunto1"><?php echo $row_Recordset1['assunto']; ?></div>
<div id="autor1"></div>
<div id="texto1" align="justify"></div>
<div id="img11"></div>
<div id="img21"></div>
<div id="img31"></div>
<div id="img41"></div>
<div id="img51"></div>
<div id="img61"></div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>a nem colocquei pra aprecer todas as variaveis pois estou testando entao acredito nao ser necessario colocar todas, coloquei apenas as que mudam no caso o valorDiscussão (5)
Carregando comentários...