I came across a problem that I can not work around. The situation is as follows, I created a search engine in mysql that results in map markup (Google Maps API) that I created. The problem is that some of the clients have blank "lat" and "lon" fields, resulting in an error in the Maps API, which is all blank. The idea is that if a client has the "lat" and "lon" fields blank, they do not echo this client. This would not result in map errors. And the other clients with all fields filled, would normally echo. I've tried using IS NOT NULL, but it does not work. PHP Code:
$sql = mysql_query("SELECT * FROM politicos WHERE name LIKE '%$busca%' OR info LIKE '%$busca%' AND lat IS NOT NULL");
while($row = mysql_fetch_array($sql)){
$name = $row['name'];
$lat = $row['lat'];
$lon = $row['lon'];
$info = $row['info'];
echo("addMarker($lat, $lon, '<b>Nome: $name</b><br />Informações: $info');\n");
}
echo result:
addMarker(, , '<b>Nome: Cliente 1</b><br />Informações: ');
This results in an error on the map
echo result if you put 0 in lat and lon:
addMarker(0, 0, '<b>Nome: Cliente 1</b><br />Informações: ');
This places the marker on the equator line: (
I do not want to echo customers with the empty "lat" and "lon" fields! If anyone can help me thank you very much!