Suppose there are 3 combo box.
SELECT COUNTRY
SELECT STATE
SELECT CITY
if i select any country from country conutrylistbox
values in the state will get automatically inserted with
database values>>
THEN on selection of state city will be inserted in city
combo box


If you can help then please Help me...

Answer Posted / mustkeem

You try this ...script...

<?php
require_once("cities/dao/BaseDao.php");

class CitiesDao extends BaseDao {

public function getCountries() {
$query = "select * from tb_countries order by country asc";
return
$this->execute($this->connection->prepareQuery($query,
Array()));
}

public function getCountryById($idCountry) {
$query = "select * from tb_countries where id_country =
:id_country";
return
$this->getSingleRow($this->connection->prepareQuery($query,
Array("id_country" => $idCountry)));
}

public function getStatesByCountry($idCountry) {
$query = "select * from tb_states where id_country =
:id_country order by state asc";
return
$this->execute($this->connection->prepareQuery($query,
Array("id_country" => $idCountry)));
}

public function getStateById($idState) {
$query = "select * from tb_states where id_state = :id_state";
return
$this->getSingleRow($this->connection->prepareQuery($query,
Array("id_state" => $idState)));
}

public function getCitiesByCountryAndState($idCountry,
$idState) {
$query = "select * from tb_cities where id_country =
:id_country and id_state = :id_state order by city asc";
return
$this->execute($this->connection->prepareQuery($query,
Array("id_country" => $idCountry, "id_state" => $idState)));
}

public function getCityById($idCity) {
$query = "select * from tb_cities where id_city = :id_city";
return
$this->getSingleRow($this->connection->prepareQuery($query,
Array("id_city" => $idCity)));
}
}
?>

Is This Answer Correct ?    7 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What classes of exceptions may be caught by a catch clause?

558


What is synchronization and why is it important?

547


what is meant by JRMP?

1811


What is the difference between ear, jar and war file?

576


what is the use of State Factories?

1911






What is abstract schema?

557


What is the RMI and Socket?

627


What is the map interface?

616


What is the difference between system.out ,system.err and system.in?

598


Write a singleton program?

573


For which statements does it make sense to use a label?

591


Is the session factory thread safe?

679


What are the oops concept?

581


Why use a datasource when you can directly specify a connection details?

534


When is the best time to validate input?

609