hi everyone
i need help in my query which is that:
1.which country name i selected from my dropdown list
2.when i select any country_name its show more info in new page.php like (this selected name show more information about country_name e.g. its captical, and cities through database in new page)

and here is my code:

<tr> <td>Country Name</td> <td> <select name="name"> <?php
      $conn = oci_connect("username", "pswrd", "db");
      $sql = 'SELECT name FROM country';
      $stid = oci_parse($conn, $sql);
      $success = oci_execute($stid);
      while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) 
      {
        echo "<option value=\"countryname1\">" . $row['NAME'] . "</option>";
      }
    ?> 

Recommended Answers

All 4 Replies

Select also ID of country.

<tr> <td>Country Name</td> <td> <select name="countryID"> <?php
      $conn = oci_connect("username", "pswrd", "db");
      $sql = 'SELECT id,name FROM country';
      $stid = oci_parse($conn, $sql);
      $success = oci_execute($stid);
      while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) 
      {
        echo "<option value=\"" . $row['ID'] . "\">" . $row['NAME'] . "</option>";
      }
    ?>

i want to dispaly all data in new page.php which i was selected country name from dropdown list

e.g.

  1. i select country_name from dropdown list (AUSTRALIA)
  2. open new page.php ans its show like that
    country name: AUSTRALIA
    Capitical:
    City1: ____
    City2:

    City3:____
    these all information pick from oracle database table country_detail

You can select by country name but it is not good practice

    echo "<option value=\"".$row['NAME']."\">".$row['NAME']."</option>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.