M
M
maxsmart2014-07-28 15:23:15
PHP
maxsmart, 2014-07-28 15:23:15

How to connect YandexMaps, PHP and MySQL?

Hello! There is such a task: there is a MySQL database (car number, address, date and time), and you need to build marks on the map based on this data. So that the result is like on the test map .
I am not a programmer myself, but I wrote something. I looked at examples from the sandbox, found multiple geocoding. Wrote the following code to add points to the map:

<?php

    while (($result = mysql_fetch_array($address))) 
    
    { 
    
      print_r (".add(ymaps.geocode('$result[0]',{results:1}))\n"); 
    
    } 
      
    ?>

And for renaming balloons:
var balloons = [<?php $myrow = mysql_query("SELECT cartime FROM data WHERE fio='$fio' AND carmodel='$carmodel' AND cardate='$cardate'"); while (($myrowresult = mysql_fetch_array($myrow))) { print_r ("'$myrowresult[0]', "); } ?>], i = 0;

everything seems to be working, except for: the very first point, I don’t know how to change it, the line is taken from the sandbox:
var objects = ymaps.geoQuery(ymaps.geocode('Москва, Слесарный переулок, д.3'))

I don't know how to remove it. And the second point, you need the map to be displayed as at the link above, so that the side menu is, with the name of the tags in the form of time and the name of the map in the form date + car number.
If anyone has done this, please share your experience!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fyodor Dostoyevsky, 2014-07-28
@frops

If you work with one of the well-known CMS, then there are some plugins for working with Yandex.Maps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question