Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    world map markers

    Hi everyone,

    I'm using jvectormap to create an interactive world map that shows alumni associated with the university I work for. However, I've come across a bit of a stumbling block. I'm using php to connect to a database with a list of countries and their respective co-ordinates. However, it's not working as when I inspect the page source nothing appears to be written.

    Here is the php (after it's connected to the database, which is fine):

    mysql_select_db("xxxxxx", $con);
    $sql="SELECT * FROM alumni-countries";
    $result = mysql_query($sql, $con); //used for country

    echo "markers: [";

    while($row = mysql_fetch_array($result))
    {
    if ($result) {
    echo "{latLng: [" . $row['Coords'] ."], name: '" . $row['Country'] . "'},";
    } else {
    echo "No data!";
    }
    }
    echo "],";

    mysql_close($con);

    ?>

    The finished results should come out something like this:

    markers: [
    {latLng: [41.50, 87.37], name: 'Chicago'},
    ],

    If any of you can help me with this issue it would be greatly appreciated, I'm pulling my hair out over it at the minute!

    Cheers,

    ilder
    Last edited by ilder; 02-01-2013 at 04:39 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    This should output something. The lest should be "markers: [". That it is not echoing anything kinda means the code is not being executed at all. See what is interfering with calling this code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •