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
What are the steps to write p-to-p model application?
wahts is mean by dynavalidatorform in struts/
what are memory considerations of jsp compares to other web components?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
What value does readline() return when it has reached the end of a file?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
What is local interface. How values will be passed?
What’s jboss cache in short?
What is the relationship between the canvas class and the graphics class?
What are various types of class loaders used by jvm?
What are the different approaches to represent an inheritance hierarchy?
Write a program to show synchronization?
Will the general public have access to the infobus apis?
Why do threads block on i/o?
Which class is the immediate superclass of the menucomponent class?