Is my dividing page program as a div in the first div, I added this code
<?php $table="am_users"; $query="select distinct(`user_email`) from $table"; $result=mysql_query($query); $num_rows = mysql_num_rows($result); while($data1=mysql_fetch_array($result)) { $data[]=$data1['user_email']; } sort($data); foreach($data as $search_term) { $js_data[] ="\"" . $search_term . "\""; } <script type="text/javascript"> var collection = [<?php echo implode($js_data, ","); ?>]; </script> ?>
below this i include my css file but division 1 works in section 2, css is not applied. This problem arises because div 1 has the value of the Js variable. If I remove var collection = []; and then css is working fine. Is it possible to transfer a value from a PHP file to a JS file. Loading time
source share