w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories

dropdown list fill from MYSQL


in fill_gov() you need to select both gov_id and area_name

 command.CommandText = "select gov_id,
gov_name from gov";

set value from gov_id

item_1.Value =
(ds_1.Tables[0].Rows[i]["gov_id"].ToString());
item_1.Text =
ds_1.Tables[0].Rows[i]["gov_name"].ToString();

and change the fill_area() select sql as below

command.CommandText = "select area_name
from area where area_name !='' and gov_id =" +
DropDownList1.SelectedValue ;

you better use parameterized SQL


Categories : C#

Related to : dropdown list fill from MYSQL
Mysql Populating dropdown based on another dropdown choice
Use the following code in your zipcode.php file. <?php /* Template Name: Zipcode Help */ ?> <?php get_header(); ?> <?php global $wpdb; $query = "SELECT * FROM zipcode group by FULLSTATE"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $dd .= "<option value='".$row['STATE']."'>".$row['FULLSTATE']."</option>"; } ?> &

Categories : Javascript
second dropdown based on selection of first dropdown using script and PHP/MySQL
<script type="text/javascript"> function get_module(){ var projid = document.getElementById('taProj').value; $.ajax({ url : //ur controller path/methodname(module), data : "id="+projid, method : 'POST', success : function(data) { //here you will get response from your controller method and manipulate as per your use..

Categories : PHP
PHP and MySQL: How to update MySQL Table using dropdown?
You have two options here: 1) Use a standard HTML form First, ensure you have a form enclosing your select input with action="yourphpscript.php" and method="POST" Then, ensure the inputs you intend to access have NAME attributes. If they don't have name attributes, then the $_POST superglobal will not be populated with them. It'll be as if they don't exist. <select name="auto_make"> &l

Categories : PHP
Dropdown may not be the same MYSQL PHP
you can send the form and validate on Server PHP Way or you validate in Browser JS Way in Jquery: $('#<idselecttwo>').bind('change' function(){ var valueOne = $('#<idselectone>').val(); var valueTwo = $('#<idselecttwo>').val(); if(valueOne == valueTwo) { alert('error'); } });

Categories : Javascript
Getting MYSQL value from dropdown box
<select name="select"> <option value="foo">foo</option> </select> PHP: $select = $_POST["select"]; echo $select; //Should return foo

Categories : PHP
© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.