|
اشکال در ترکیب جی کوئری با PHP
سلام دوستان , من یه قطعه کد جاوا اسکریپت دارم که مربوط به گالری هست و عکس ها رو داره از یه مسیر مشخص میخونه.
قطعه کد اینجوریه :
کد php:
<script type="text/javascript"> supersizedImgPath = 'media/mod_funsupersized/img/'; supersizedOptions = {"autoplay":1,"fit_always":0,"fit_landscape":1,"fi t_portrait":0, "horizontal_center":1,"vertical_cent er":1,"image_protect":1,"keyboard_nav":1,"min_heig ht":0,"min_width":0, "new_window":1,"pause_hover":0 ,"performance":1,"random":0,"slideshow":1,"slide_i nterval":5000, "slide_links":false,"start_slide":1, "stop_loop":0,"thumb_links":0,"thumbnail_navigatio n":0,"transition":1, "transition_speed":750,"arrow_ navigation":0,"progress_bar":0,"mouse_scrub":1, "pl ay_button":1,"slide_counter":1,"slide_caption":0," slides": [{"image":"images/bg/IMG_1226.jpg"},{"image":"images/bg/IMG_1227.jpg"},{"image":"images/bg/IMG_1234.jpg"}, {"image":"images/bg/IMG_1237.jpg"},{"image":"images/bg/IMG_1243.jpg"},{"image":"images/bg/IMG_1244.jpg"}]}; </script><!-- end nostyle content -->
میخوام عکس ها رو از پایگاه داده بخونه در واقع این قسمت ها {"image":"images/bg/IMG_1227.jpg"}
این قطعه کد رو واسش نوشتم ولی جواب نمیده :
کد php:
<script type="text/javascript"> supersizedImgPath = 'media/mod_funsupersized/img/'; supersizedOptions = {"autoplay":1, "fit_always":0,"fit_landscape":1,"fi t_portrait":0, "horizontal_center":1,"vertical_cent er":1,"image_protect":1,"keyboard_nav":1,"min_heig ht":0,"min_width":0, "new_window":1,"pause_hover":0 ,"performance":1,"random":0,"slideshow":1 ,"slide_i nterval":5000,"slide_links":false,"start_slide":1, "stop_loop":0,"thumb_links":0,"thumbnail_navigatio n": 0,"transition":1,"transition_speed":750,"arrow_ navigation":0,"progress_bar":0,"mouse_scrub": 1,"pl ay_button":1,"slide_counter":1,"slide_caption":0," slides":[ </script> <?php include('db.php'); $sql="SELECT * FROM `slider`"; $result=mysql_query($sql,$connection); $i=0; /*echo "";*/ while($row=mysql_fetch_array($result)) { echo $row['name']; if($i!=0) echo "<script>,{'image':'".$row['name']."'} </script>"; else { echo "<script> {'image':'".$row['name']."'} </script>"; $i++; } } ?> <script> ]}; </script><!-- end nostyle content -->
اشکالش چیه؟؟
|
من نه آنکه گویی هستم نه آنکه گویند / من همانم که همانم ..
|
|