Please help with this query.
I have 2 tables in a database, countires and cities. states looks like this
countries
id -----------country
1 ------------uk
2 ------------us
3 ------------japan
cities
id ---country ----city
1 ----1 ----------London
2 ----1 ----------Manchester
3 ----2 ----------New York
4 ----2 ----------Washington
5 ----2 ----------San Francisco
6 ----2 ----------Las Vegas
7 ----2 ----------New Orleans
8 ----3 ----------Tokyo
I have queried the database as follows:
///////////////////////// Make the country query //////////////////////////////
$q_country = "SELECT * FROM countries";
$result_country = mysqli_query($dbc, $q_country);
$row_country = mysqli_fetch_array($result_country);
///////////////////////// Make the city query //////////////////////////////
$q_city = "SELECT * FROM cities";
$result_city = mysqli_query($dbc, $q_city);
$row_name = mysqli_fetch_array($result_name);
I want to display the data as follows:
Country - UK
Cities - London, Manchester
Country - US
Cities - New York, Washinton, San Francisco, Las Vegas, New Orleans
Country - Japan
Cities - Tokyo
I'm new to PHP and just can't work it out. Please can somebody point me in the right direction?!!!! PLEASE!!!!!
License Issue - service type user
Hi,
Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on deciding where would be best to begin or which is the best way to approach the problem.The company I work
PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing following insert statement. I am new to Oracle SPs, so could someone help me to solve the issue.
How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browser changes immediately but there is a lag until the Sys.UI.DomElement.getBounds method will return
PHP hyperlinks generator
HiI need some help to get this done using php:1 - I have few hyperlinks say 500 in format like:<a href="http://domaina.com/1.html"
update post issues
I am trying to create an update to a post function, while the update does occur, the page routing and selecting of posts to be updated is whats getting screwed up. I have so many files involved in
Count on multidimensional array
Hi, i got an array as below:Array( => Array ( [2009-12-08] => 1 ) [1] => Array ( [2009-12-07] => 1 ) [2]
Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.But if I want to put a document of any decent length, eg. 500 characters (I guess), I get the error
Weird problem with SELECT command..Help!
Hi!It seems I'm having a really weird problem with SQL SELECT command....I have table into a mySQL DB wich as 4 entry in it. I created the select command to retrieve the data and only 3 of the 4 entry
Stuck with preg_replace
Hi,I'm trying to use preg_replace to remove part of the IP address submitted using a form on my website. The full IP is entered into my SQL database, but when printing it on the website I want to