Hi I have this sample code to load random quotes.
PHP Code:
<?php
//Selecting Random quotes from database --randomquotes.php
require('dbconnection.php');
// $temp=10;
$sql = "SELECT * FROM db.q order by rand() LIMIT 1";
$res = mysql_query($sql,$con);
while ($res1=mysql_fetch_assoc($res))
{
print "<em>".$res1['quote']."</em>";
}
?>
HTML CODE:
<div class="class_box_shadow_quote">
<?php
require('randomquotes.php');
?>
</div>
Jquery Code:
<script>
var $j = jQuery.noConflict();
$j(document).ready(function(){
setInterval(function() {
$j(".class_box_shadow_quote").load('randomquotes.php');
}, 7000);
});
</script>
This code is working well for the first time , but is getting stuck on second quote and is not changing the quote. Also everytime i see the second quote to be the same always. What is the problem . Please help?