PHP Mysqli foreach not pulling data -
i have got following php sites inside <script> tags , trying pull data table map using mysqli
but in console.log shows following position: new google.maps.latlng(, ),
i'm unsure have went wrong in code. database connection live , inside variable $con
php
<?php $count = 0; $rowset = $con->query("select * map"); foreach ($rowset $row): ?> add_marker({ position: new google.maps.latlng(<?php echo $row->lat ?>, <?php echo $row->lng ?>), title:<?php echo $row->location ?>, map:map }); <?php $count++; endforeach; ?> thanks in advance
you not pulling data. replace foreach line this:
while ($row = $rowset->fetch_object()): that should it.
edit: don't forget replace endforach; endwhile;
Comments
Post a Comment