Jump to content
Fórum Script Brasil
  • 0

Query String


mauricio

Question

while ($row = mysql_fetch_assoc($result))

{

  $id = $row['id'];

  $texto = $row['texto'];

  $nome = $row['nome'];

  $titulo = $row['titulo'];

  echo "$id";

  echo " - ";

  echo "$titulo";

  echo "<br>";

  echo " - ";

  echo "$texto";

  echo "<br>";

  echo " - ";

  echo "$nome";

  echo "<br>";

}

vejam o erro

http://www.atxclan.com/query/paginacao.php

aparece %titulo :\

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

<html>

<head>

<title>Paginação</title>

<style type="text/css">

body { font-family: Verdana; font-size: 12px; }

a { font-family: Verdana; font-size: 12px; color: #000000; text-decoration: none; }

a:hover { color: #FE5400; text-decoration: none; }

</style>

</head>

<body>

<?

include("config.php");

$link_p_pag = 5;

$reg_p_pag = 30;

$pag = $_GET['pag'];

$busca = mysql_query("SELECT count(*) FROM paginacao;");

$registros = mysql_result($busca,0);

echo "<font face=verdana size=1>";

echo "Número de registros: ";

echo "<b>$registros</b>";

echo "<br>";

$num_total_paginas = ($registros%$reg_p_pag==0)?$registros/$reg_p_pag:floor($registros/$reg_p_pag)+1;

echo "Número de páginas: ";

echo "<b>$num_total_paginas</b>";

echo "<br>";

echo "Registros por páginas: ";

echo "<b>$reg_p_pag</b>";

echo "<br><br>";

if ($pag>$num_total_paginas)

echo "Error<br><br>";

else

if (!$pag)

$pag = 1;

$inicio = ($reg_p_pag*$pag)-$reg_p_pag;

$query = "SELECT * FROM paginacao ORDER BY id DESC LIMIT $inicio, $reg_p_pag";

$result = @mysql_query($query);

while ($row = mysql_fetch_assoc($result))

{

  $id = $row['id];

  $texto = $row['texto'];

  $nome = $row['nome'];

  $titulo = $row['titulo'];

  echo $id;

  echo " - ";

  echo $titulo;

  echo "<br>";

  echo " - ";

  echo $texto;

  echo "<br>";

  echo " - ";

  echo $nome;

  echo "<br>";

}

echo "<font face=verdana size=1><br>";

$anterior = $pag-1;

if ($anterior<1)

echo "<font face=verdana size=1>« Anterior - ";

else

echo "« <a href=\"{$_SERVER['PHP_SELF']}?pag=$anterior\"><font face=verdana size=1>Anterior</a> - ";

for($i=1; $i<$pag; $i++)

if($i>=$pag-$link_p_pag)

echo "<a href=\"{$_SERVER['PHP_SELF']}?pag=$i\"><font face=verdana size=1>$i</a> - ";

echo "<font face=verdana size=1><b>[ $pag ]</b>";

for($i=$pag+1; $i<=$num_total_paginas; $i++)

if($i<=$pag+$link_p_pag)

echo " - <a href=\"{$_SERVER['PHP_SELF']}?pag=$i\"><font face=verdana size=1>$i</a>";

$proxima = $pag+1;

if ($proxima>$num_total_paginas)

echo "<font face=verdana size=1> - Próxima »";

else

echo " - <a href=\"{$_SERVER['PHP_SELF']}?pag=$proxima\"><font face=verdana size=1>Próxima</a> »";

?>

</body>

</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...