Dear Sirs!
I have this php syntax in my <head>.
<?php
// MySQL
mysql_connect("localhost", "fundis_petrol", "petrol123") or die(mysql_error());
mysql_select_db("fundis_petrol") or die(mysql_error());
// Table
$result = mysql_query("SELECT * FROM `fillingstations` LIMIT 0 , 30")
or die(mysql_error());
// Print
while($row = mysql_fetch_array($result)){
echo $row[2];
}
?>
And I also have this JS (Google Maps API) in my <head>.
var beaches = [
['Miskolci road / Shell Station', <?php echo $row[2]; ?> , 4],
['Szabadsag utja / Töltöallomas', 47.559025, 19.281415, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];
But when I try to echo the number with a PHP syntax in my Javascript, the whole map disappears.
I think that it is a wrong way of outputting the number there..
I would be grateful if you could help me,
Tibor :)