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

Are enterprise beans allowed to use thread.sleep()?

647


How would you create a button with rounded edges?

556


What is the difference between the string and stringbuffer classes?

543


Which are the different segments of memory?

593


difference between  ejb,struts,hibernate,spring and jsp

2300






how to use debug in my elipse to solve problems that exist in my project

1761


Explain the advantages and disadvantages of detached objects.

574


What are the different methods of identifying an object?

573


How are the elements of a cardlayout organized?

596


What are the different class loaders used by jvm?

595


What do you need to set-up a cluster with jboss?

573


what are the advantages of JTA over JTS?

1668


What is an abstract method?

590


What is the difference between a menuitem and a checkboxmenuitem?

581


What is difference between object state and behavior?

578