...php file "col_list.php"
<html dir="rtl">
<head>
<meta http-equiv="Content-Language" content="ar-ae">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>New Page 1</title>
</head>
<body>
<?php
include('connect.php');
$sql="select COUNTRY_ID,COUNTRY from COUNTRIES";
$sql_statement=OCIParse($connection,$sql);
OCIExecute($sql_statement);
$nrows = OCIFetchStatement($sql_statement,$results);
if($nrows>0){
for ( $i = 0; $i < $nrows; $i++ ) {
reset($results);
while ( $column = each($results) ) {
$data = $column['value'];
}
}
}
?>
<form method="POST" action="col_list.php" name="form1">
<p align="center"><input type=text name="name" >
<p align="center"><select size="1" name="country" onChange=submit();>
<option selected>--------------Select Country------------</option>
<?php for ($i=0;$i<$nrows;$i++) {
echo("<option >"."$data[$i]"."</option>");
}
?>
</select></p>
<p align="center"><select size="1" name="cities">
<option selected>----------Select City-----------</option>
<?
$sql_city="select CITY_ID,CITIES from CITIES where COUNTRY_ID=(select COUNTRY_ID from COUNTRY where COUNTRY='$country')";
$sql_statement_city=OCIParse($connection,$sql_city);
OCIExecute($sql_statement_city);
$nrows2 = OCIFetchStatement($sql_statement_city,$results);
for ( $j = 0; $j < $nrows2; $j++ ) {
reset($results);
while ( $column1 = each($results) ) {
$data1 = $column1['value'];
}
}
for ( $j = 0; $j < $nrows2; $j++ ) {
echo("<option> "."$data1[$j]"."</option>");
}
OCIFreeStatement($sql_statement);
OCIFreeStatement($sql_statement_city);
OCILogoff($connection);
?>
</form>
</select></p>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
This is my code ... plz check it and tell me how can i solve the problem
thanks for your help with my regards