Jump to content

viktex1d

New Members
  • Posts

    5
  • Joined

  • Last visited

viktex1d's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much for replying. I would like to use a submit button. What I am doing is, get the input in a page and upon getting input(through a button) redirect to the second page containing the second drop down box. But, my friend suggested that it is not a very good design.
  2. Guys, I have a two drop down boxes in a webpage. Is it possible that I can use the value of the first drop down box to alter the second one. I don't want to use Javascript. Is it possible to refresh the page using the refresh in header??
  3. Thank you very much, I understand the mistake.
  4. I am working on a small form that retrieves and stores values to a DB. I want to retrieve the contents of a table and use it in a drop down box. The code I have used is: <?php // Connect to the db. require ('mysqli_connect.php'); // Make the query: $q = "SELECT employee_name from employee where dept_id=3 ORDER BY employee_id ASC"; // Run the query. $r = mysqli_query ($dbc, $q); if ($r) // If it ran OK, display the records. { echo '<select name="employee_name">'; // Fetch and print all the records: while ($row = mysqli_fetch_array($r)) { echo '<option value="'.$row['employee_name'] . '>"'.$row['employee_name'] .'</option>'; } echo "</select>"; } mysqli_free_result ($r); // Free up the resources. mysqli_close($dbc); // Close the database connection. ?> The code works perfectly in MySQL console. But, it returns an empty drop down box in the webpage. Guys, please help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.