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
whats is statement and procedure
Where we can write Rmi registry in the code, without having to write it at the command prompt?
How would you create a button with rounded edges?
Can you control when passivation occurs?
Describe responsibilities of Activator?
what are the activation groupworks?
What is the difference between static and non-static with examples?
Explain the different types of memory used by jvm?
wahts is mean by dynavalidatorform in struts/
What restrictions are placed on the location of a package statement within a source code file?
What must a class do to implement an interface?
What is table mutation and how do you avoid it?
AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?
Why does the tag url-encode javascript and mailto links?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?