Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8577035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:04:21+00:00 2026-06-11T20:04:21+00:00

i am using this php code to retrieve lat and lon from MySQL database,the

  • 0

i am using this php code to retrieve lat and lon from MySQL database,the result values should be given as input to the google map.so when i run the query the output should go to google maps. as parameters how can i do this?

This is the php code.

    mysql_select_db("theatdb", $con);

    $result = mysql_query("SELECT Lat,Lon FROM theaters
    WHERE theater_name='theater_name'");

    while($row = mysql_fetch_array($result))
      {
      echo $row['theater_name'];
      echo "<br />";
      }
    ?> 

This is the google maps code

 function initialize() {
        var latlng = new google.maps.LatLng(12.91869,77.594051);
        var myOptions = {
          zoom: 12,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };

The php code is retrieving the lat and lon value i want to pass the result to google maps.how can i do that? anyone help m.. thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:04:22+00:00Added an answer on June 11, 2026 at 8:04 pm

    Use mysql_fetch_assoc() to get associative array from your database since you are getting only one result:

    <?php
        mysql_select_db("theatdb", $con);
        $result = mysql_query("SELECT Lat,Lon FROM theaters WHERE theater_name='theater_name'");
        $row = mysql_fetch_assoc($result);
        echo $row['theater_name'];
    ?>
    
    <script type="text/javascript">
    function initialize() {
        var latlng = new google.maps.LatLng(<?php echo $row['Lat'];?>,<?php echo $row['Lon'];?>);
        var myOptions = {
          zoom: 12,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this simple code to retrieve a value from a PHP script: package
I am using the following code to generate excel from sql through php.this is
This is the code I'm using: <?php // Set the MySQL Configuration $db_host =
I'm trying to retrieve data from an api using curl with this code: $xml_data
I was using the following code to retrieve HTML snippets from a database table
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
I'm trying to retrieve articles through wikipedia API using this code $url = 'http://en.wikipedia.org/w/api.php?action=parse&page=example&format=json&prop=text';
I have written php code to retrieve data from database to div in webpage.i
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
I am using this code to send mail with php http://www.siteduzero.com/tutoriel-3-35146-e-mail-envoyer-un-e-mail-en-php.html#ss_part_4 . This code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.