Hi guys

I have used this script to call locations the problem is it calls the locations from the file and I want to call them from the database

How can i edit this file to call them from the database?

example.php

PHP Code:
<script type="text/javascript" src="http://www.notexperienced.co.uk/employers/js/default.aspx?prx=http://www.dhtmlgoodies.com/ajax.js"></script>
<script type="text/javascript">
    
var ajax = new sack();

function getCityList(sel)
{
    var countryCode = sel.options[sel.selectedIndex].value;
    document.getElementById('dhtmlgoodies_city').options.length = 0;    // Empty city select box
    if(countryCode.length>0){
        ajax.requestFile = 'getCities.php?countryCode='+countryCode;    // Specifying which file to get
        ajax.onCompletion = createCities;    // Specify function that will be executed after file has been found
        ajax.runAJAX();        // Execute AJAX function
    }
}

function createCities()
{
    var obj = document.getElementById('dhtmlgoodies_city');
    eval(ajax.response);    // Executing the response from Ajax as Javascript code    
}

        
</script>

<form action="" method="post">
<table>
    <tr>
        <td>Country: </td>
        <td><select id="dhtmlgoodies_country" name="dhtmlgoodies_country" onchange="getCityList(this)">
            <option value="">Select</option>
            <option value="dk">Denmark</option>
            <option value="no">Norway</option>
            <option value="us">US</option>
        </select>
        </td>
    </tr>
    <tr>
        <td>City: </td>
        <td><select id="dhtmlgoodies_city" name="dhtmlgoodies_city">
        
        </select>
        </td>
    </tr>
</table> 


getCities.php

PHP Code:
<?php

if(isset($_GET['countryCode'])){
  
  switch(
$_GET['countryCode']){
    
    case 
"no":
      echo 
"obj.options[obj.options.length] = new Option('Bergen','1');\n";
      echo 
"obj.options[obj.options.length] = new Option('Haugesund','2');\n";
      echo 
"obj.options[obj.options.length] = new Option('Oslo','3');\n";
      echo 
"obj.options[obj.options.length] = new Option('Stavanger','4');\n";
      
      break;
    case 
"dk":
      
      echo 
"obj.options[obj.options.length] = new Option('Aalborg','11');\n";
      echo 
"obj.options[obj.options.length] = new Option('Copenhagen','12');\n";
      echo 
"obj.options[obj.options.length] = new Option('Odense','13');\n";
      
      break;
    case 
"us":
      
      echo 
"obj.options[obj.options.length] = new Option('Atlanta','21');\n";
      echo 
"obj.options[obj.options.length] = new Option('Chicago','22');\n";
      echo 
"obj.options[obj.options.length] = new Option('Denver','23');\n";
      echo 
"obj.options[obj.options.length] = new Option('Los Angeles','24');\n";
      echo 
"obj.options[obj.options.length] = new Option('New York','25');\n";
      echo 
"obj.options[obj.options.length] = new Option('San Fransisco','26');\n";
      echo 
"obj.options[obj.options.length] = new Option('Seattle','27');\n";
      
      break;
  }  
}

?>