Hi ,
I am facing a typical problem while using while loop .
I have inserted php code with javascript. Now when i am running the while loops its working fine. No issues. With Mozilla i don't have any problem, but with ie its giving javascript error.
here is my code.
<script type="text/javascript">
<?php
$slideimg1="SELECT image_id,heading,description FROM slide";
$slideimg1=mysql_query($slideimg1);
?>
if(!window.slider) var slider={};slider.data=[<?php while($slidedetails=mysql_fetch_array($slideimg1)){?>{"id":"<?php echo $slidedetails['image_id']?>","client":"<?php echo $slidedetails['heading']?>","desc":"<?php echo $slidedetails['description']?>"},
<?php } ?>
];
</script>
Its php tagged with javascript. The loop is running fine but it prints , in every line. I don't want , in my last line. What is the way out. Please help me.