Page 1 of 1

image slider in php using mysql

Posted: Sat Apr 27, 2013 3:19 pm
by joti.parkash
i am using below code for image slider but slider in not working
<style type="text/css">
<!--
.fadein { position:relative; width:500px; height:332px; }
.fadein img { position:absolute; left:0; top:0; }
}
-->
</style>
<script>
$(function(){
$('.fadein img:gt(0)').hide();
setInterval(function(){
$('.fadein :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('.fadein');},
300);
});
</script>
<?php
// Connects to your Database
mysql_connect("Localhost", "root", "") or die(mysql_error()) ;
mysql_select_db("realty") or die(mysql_error()) ;

//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM upload_images ") or die(mysql_error());

echo "<div class=\"fadein\">";
while($info = mysql_fetch_array( $data ))
{
//Outputs the image and other data
echo "<img src=upload/{$info['image']} />";
}
echo "</div>";
?>

but the slider is not working please help me
thanks