What is wrong with this code?
Posted: Fri Nov 20, 2009 7:19 am
Can anyone tell me what is wrong with this code:
What I wan't is probably clear here: When I do a "SELECT title, latitude, longitude FROM jos_phocamaps_marker" it displays me:
title latitude longitude
Germany 51.165691 10.451526
Austria 47.516231 14.550072
I want to get those coordinates and to add them into another table called jos_js_job_countries.
I would appreciate any help
Code: Select all
$sql = "SELECT title, latitude, longitude FROM jos_phocamaps_marker";
$query = mysql_query($sql) or die(mysql_error());
$sqlInsert = 'UPDATE jos_js_job_countries SET latitude = "$latitude", longitude = "$longitude" WHERE name = "$countryName"';
while($row = mysql_fetch_array($query)) {
$latitude = $row['latitude'];
$longitude = $row['longitude'];
$countryName = $row['title'];
mysql_query($sqlInsert);
}title latitude longitude
Germany 51.165691 10.451526
Austria 47.516231 14.550072
I want to get those coordinates and to add them into another table called jos_js_job_countries.
I would appreciate any help