Jump to content

Recommended Posts

Posted (edited)

Eu carrego para apresentar os 5 dados seguintes e não apresenta alguém me pode dizer onde ta o erro sff ?


<script type="text/javascript" language="javascript" src="js/jquery.js"></script>
<script type="text/javascript" language="javascript">
$(function($) {

$("#mais").click(function() {

var ultimo = $("#frases p:last").attr("lang");

$("#status").html("<img src='images/loader.gif' alt='Enviando' /><br>");

$.post("ajax/buscar.php", {ultimo:ultimo}, function(resposta) {

$("#status").empty();

$("#frases").append(resposta);
});
});
});
</script>
<?php
include "cont.php";
$query = mysql_query('SELECT * FROM anedota ORDER BY id_anedota LIMIT 0,5');
while ($row = mysql_fetch_object($query))
echo"<div class='post'>
<a href='verand-{$row->titulo}-{$row->id_anedota}'><h2>$row->titulo</h2></a>
<p lang='{$row->id_anedota}'>$row->anedota</p>

</div>";
?>

<div id="carregar"><span id="status"></span> <a href="javascript:func()" id="mais">Mais frases </a></div>

busca.php

<?php
require_once('../cont.php');
$ultimo = (int) $_POST['ultimo'];
if ($ultimo==0)
{
echo "ERRO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
}
else{
$query = mysql_query("SELECT * FROM anedota WHERE id_anedota < $ultimo ORDER BY id_anedota DESC LIMIT 0,3");
while ($row = mysql_fetch_object($query))
echo"<div class='post'>
<a href='verand-{$row->titulo}-{$row->id_anedota}'><h2>$row->titulo</h2></a>
<p lang='{$row->id_anedota}'>$row->anedota</p>
</div>";
}
?>

Obrigada

Edited by yoda

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.