Tengo un slider que levanta los datos de una tabla, de la siguiente manera:
Código PHP:
$sql="SELECT * FROM `banners` ORDER BY `id` DESC LIMIT 4";
$banners = $rs->get_object_list($sql);
<?php foreach($banners as $ban) {
$imagen="imagenes/banners/$ban->id/img.jpg"; ?>
<img id="<?php echo $ban->id ?>" align="center" src="<?php echo $imagen ?>" class="slide" alt=""/>
<?php } ?>
Código HTML:
<script type="text/javascript"> if(!window.slider) var slider={}; slider.data=[{"id":"1","client":"","desc":""},{"id":"2","client":"","desc":""},{"id":"3","client":"","desc":""},{"id":"4","client":"","desc":""}]; </script>
intenté algo así
Código HTML:
slider.data=[{"id":"slide-img-<?php echo $ban->id ?>","client":"","desc":""}];
Muchas gracias de antemano!