|
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 03:39 PM..
|