denicio
(usa Outra)
Enviado em 09/11/2012 - 17:41h
Obrigado aos amigos Emiliano e d_lepera ,pela ajuda o script geral ficou assim:
detalhes.php
<?php require_once('Connections/conexao.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 1;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "1";
if (isset($_GET['cod_prod'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['cod_prod'] : addslashes($_GET['cod_prod']);
}
mysql_select_db($database_conexao, $conexao);
$query_Recordset1 = sprintf("SELECT * FROM produtos WHERE cod_prod = %s", $colname_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $conexao) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<?php
echo "<table width=\"88%\" height=\"10\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>"; //Inicia a tabela
echo "<td align=center ><img src='".$row_Recordset1['fot_peq']."' width='150' height='150' border='0'><br>";
echo $row_Recordset1['cod_prod']."<br>";
echo $row_Recordset1['nome_prod']."<br>";
echo $row_Recordset1['descricao']."<br>";
echo '<a href="detalhes.php?cod_prod='.$row_Recordset1['cod_prod'].'">Ver Detalhes</a>';
echo "</td>";
?>
um forte abraço a todos e obrigado de coração,valeu mesmo.