How to show multiple areas by location in google maps using php

后端 未结 4 1572
闹比i
闹比i 2021-01-22 07:59

Here is the Initialise function.....

        function initialize() {

Here the variables $Latitude,$Longitude are array values so how can i stor

4条回答
  •  难免孤独
    2021-01-22 08:14

    Click here to report this';}
        $locations=array();
        $uname="root";
        $pass="";
        $servername="localhost";
        $dbname="bcremote";
        $db=new mysqli($servername,$uname,$pass,$dbname);
        $query =  $db->query('SELECT * FROM location');
        while( $row = $query->fetch_assoc() ){
            $name = $row['uname'];
            $longitude = $row['longitude'];                              
            $latitude = $row['latitude'];
            /* Each row is added as a new array */
            $locations[]=array( 'name'=>$name, 'lat'=>$latitude, 'lng'=>$longitude );
        }
        //echo $locations[0]['name'].": In stock: ".$locations[0]['lat'].", sold: ".$locations[0]['lng'].".
    "; //echo $locations[1]['name'].": In stock: ".$locations[1]['lat'].", sold: ".$locations[1]['lng'].".
    "; ?>

    This code Snippet uses Dynamic Content without using JSON or XML. This below code is what we see in the Browser View Source tool. Hope this helps you...

    
    

提交回复
热议问题